Skip to content

Commit 234eca2

Browse files
committed
Fix loop in YYTextDrawInnerShadow()
Ref: ibireme#876
1 parent b144f1f commit 234eca2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

YYText/Component/YYTextLayout.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3098,7 +3098,10 @@ static void YYTextDrawInnerShadow(YYTextLayout *layout, CGContextRef context, CG
30983098
CTRunGetPositions(run, CFRangeMake(0, 1), &runPosition);
30993099
CGRect runImageBounds = CTRunGetImageBounds(run, context, CFRangeMake(0, 0));
31003100
runImageBounds.origin.x += runPosition.x;
3101-
if (runImageBounds.size.width < 0.1 || runImageBounds.size.height < 0.1) continue;
3101+
if (runImageBounds.size.width < 0.1 || runImageBounds.size.height < 0.1) {
3102+
shadow = shadow.subShadow;
3103+
continue;
3104+
}
31023105

31033106
CFDictionaryRef runAttrs = CTRunGetAttributes(run);
31043107
NSValue *glyphTransformValue = CFDictionaryGetValue(runAttrs, (__bridge const void *)(YYTextGlyphTransformAttributeName));

0 commit comments

Comments
 (0)