-
Notifications
You must be signed in to change notification settings - Fork 904
Fix UIText issue and Label getContentSize value wrong in retina mode #3306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi, @ntrrgc the issue with label under retina display have been fixed, please take a look |
node._strokeShadowOffsetX = locStrokeShadowOffsetX; | ||
node._strokeShadowOffsetY = locStrokeShadowOffsetY; | ||
|
||
// need computing _anchorPointInPoints | ||
var locAP = node._anchorPoint; | ||
this._anchorPointInPoints.x = (locStrokeShadowOffsetX * 0.5) + ((locSize.width - locStrokeShadowOffsetX) * locAP.x); | ||
this._anchorPointInPoints.y = (locStrokeShadowOffsetY * 0.5) + ((locSize.height - locStrokeShadowOffsetY) * locAP.y); | ||
this._anchorPointInPoints.y = (locStrokeShadowOffsetY * 0.5) + ((locSize.width - locStrokeShadowOffsetY) * locAP.y); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have you substituted height
for width
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my bad 😂
How is it supposed to work? |
this._texRect.height = locSize.height; | ||
} | ||
var nodeW = locSize.width / pixelRatio, nodeH = locSize.height / pixelRatio; | ||
node.setContentSize(nodeW, nodeH); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are setting the design content size here...
return true; | ||
} | ||
this._saveStatus(); | ||
node.setTextureRect(cc.rect(0, 0, width, height)); | ||
node.setTextureRect(this._texRect); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it's being overwritten here. See the default implementation of setTextureRect() in CCSprite: https://github.com/cocos2d/cocos2d-html5/blob/develop/cocos2d/core/sprites/CCSprite.js#L738
I don't know if it's better or worse, but here is a simpler solution: #3407 |
Fixed: #3294