Skip to content

Commit de5f52a

Browse files
committed
Honor device pixel ratio in CCLabelTTF.getContentSize()
1 parent e102082 commit de5f52a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cocos2d/core/labelttf/CCLabelTTF.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,9 @@ cc.LabelTTF = cc.Sprite.extend(/** @lends cc.LabelTTF# */{
806806
getContentSize: function () {
807807
if (this._needUpdateTexture)
808808
this._renderCmd._updateTTF();
809-
return cc.size(this._contentSize);
809+
return cc.size(
810+
this._contentSize.width / cc.view.getDevicePixelRatio(),
811+
this._contentSize.height / cc.view.getDevicePixelRatio());
810812
},
811813

812814
_getWidth: function () {

0 commit comments

Comments
 (0)