Skip to content

Commit 7c3833a

Browse files
committed
Simplifying font color setup
Repeat of PR in #1320 that got lost due branch changes and GitHub limitations.
1 parent c7a8c5e commit 7c3833a

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)