From c1d76508b13373fdc9ddfd3ee802b09e880224e8 Mon Sep 17 00:00:00 2001 From: changsanjiang Date: Thu, 4 Apr 2019 22:52:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20YYTextDrawInnerShadow()=20?= =?UTF-8?q?=E4=B8=AD=20while=E6=97=A0=E9=99=90=E5=BE=AA=E7=8E=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YYText/Component/YYTextLayout.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/YYText/Component/YYTextLayout.m b/YYText/Component/YYTextLayout.m index 708ba1dd..f77f9acc 100644 --- a/YYText/Component/YYTextLayout.m +++ b/YYText/Component/YYTextLayout.m @@ -3100,7 +3100,10 @@ static void YYTextDrawInnerShadow(YYTextLayout *layout, CGContextRef context, CG CTRunGetPositions(run, CFRangeMake(0, 1), &runPosition); CGRect runImageBounds = CTRunGetImageBounds(run, context, CFRangeMake(0, 0)); runImageBounds.origin.x += runPosition.x; - if (runImageBounds.size.width < 0.1 || runImageBounds.size.height < 0.1) continue; + if (runImageBounds.size.width < 0.1 || runImageBounds.size.height < 0.1) { + shadow = shadow.subShadow; + continue; + } CFDictionaryRef runAttrs = CTRunGetAttributes(run); NSValue *glyphTransformValue = CFDictionaryGetValue(runAttrs, (__bridge const void *)(YYTextGlyphTransformAttributeName));