Skip to content

Commit 0214207

Browse files
committed
Merge pull request #1365 from richardgroves/patch-3
Simplifying font color setup
2 parents c7a8c5e + 7c3833a commit 0214207

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

cocos2d/CCLabelTTF.m

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -886,15 +886,9 @@ - (CCTexture*) createTextureWithString:(NSString*) string useFullColor:(BOOL)use
886886
}
887887

888888
// Handle font color
889-
890-
CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
891-
const CGFloat components[] = {_fontColor.red, _fontColor.green, _fontColor.blue, _fontColor.alpha};
892-
CGColorRef color = CGColorCreate(colorspace, components);
893-
CGColorSpaceRelease(colorspace);
894-
889+
CGColorRef color = _fontColor.CGColor;
895890
CGContextSetFillColorWithColor(context, color);
896891
CGContextSetStrokeColorWithColor(context, color);
897-
CGColorRelease(color);
898892

899893
[self drawString:string withFont:font inContext:context inRect:drawArea];
900894

0 commit comments

Comments
 (0)