Skip to content

Commit 06b3598

Browse files
committed
Merge pull request #679 from NickyWeber/bugfix/cclabelttf_shadow_overlap_strokessue
Bugfix: Shadows overlapping/glow in stroke.
2 parents 2ad357e + c5d4230 commit 06b3598

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cocos2d/CCLabelTTF.m

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -655,17 +655,16 @@ - (CCTexture*) createTextureWithAttributedString:(NSAttributedString*)attributed
655655
[outlineString addAttribute:NSForegroundColorAttributeName value:color range:NSMakeRange(0, outlineString.length)];
656656

657657
[outlineString drawInRect:drawArea];
658-
659-
CGContextSetTextDrawingMode(context, kCGTextFill);
660-
658+
661659
// Don't draw shadow for main font
662660
CGContextSetShadowWithColor(context, CGSizeZero, 0, NULL);
663-
661+
664662
if (hasShadow)
665663
{
666664
// Draw outline again because shadow overlap
667665
[outlineString drawInRect:drawArea];
668666
}
667+
CGContextSetTextDrawingMode(context, kCGTextFill);
669668
}
670669

671670
[attributedString drawInRect:drawArea];

0 commit comments

Comments
 (0)