Skip to content

Commit

Permalink
Merge pull request #612 from cocojoe/develop-v3
Browse files Browse the repository at this point in the history
Fix CCLabelBMFont use texture content scale to calculate font position.

Former-commit-id: c6854e4
  • Loading branch information
slembcke committed Feb 23, 2014
2 parents 086d1b1 + 751ae3c commit 4f5eca5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cocos2d/CCLabelBMFont.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#import "CCLabelBMFont_Private.h"
#import "CCSprite_Private.h"
#import "CCSpriteBatchNode_Private.h"
#import "CCDrawingPrimitives.h"

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

// update kerning
Expand Down

0 comments on commit 4f5eca5

Please sign in to comment.