Skip to content

Commit 4f5eca5

Browse files
committed
Merge pull request #612 from cocojoe/develop-v3
Fix CCLabelBMFont use texture content scale to calculate font position. Former-commit-id: c6854e4
2 parents 086d1b1 + 751ae3c commit 4f5eca5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cocos2d/CCLabelBMFont.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#import "CCLabelBMFont_Private.h"
4848
#import "CCSprite_Private.h"
4949
#import "CCSpriteBatchNode_Private.h"
50+
#import "CCDrawingPrimitives.h"
5051

5152
#pragma mark -
5253
#pragma mark FNTConfig Cache - free functions
@@ -815,7 +816,7 @@ -(void) createFontChars
815816
// See issue 1343. cast( signed short + unsigned integer ) == unsigned integer (sign is lost!)
816817
NSInteger yOffset = _configuration->_commonHeight - fontDef.yOffset;
817818
CGPoint fontPos = ccp( (CGFloat)nextFontPositionX + fontDef.xOffset + fontDef.rect.size.width*0.5f + kerningAmount,
818-
(CGFloat)nextFontPositionY + yOffset - rect.size.height*0.5f * __ccContentScaleFactor );
819+
(CGFloat)nextFontPositionY + yOffset - rect.size.height*0.5f * _textureAtlas.texture.contentScale );
819820
fontChar.position = ccpMult(fontPos, contentScale);
820821

821822
// update kerning

0 commit comments

Comments
 (0)