Skip to content

Conversation

pandamicro
Copy link
Contributor

@pandamicro pandamicro commented Jun 24, 2016

Fixed: #3294

@pandamicro
Copy link
Contributor Author

Hi, @ntrrgc the issue with label under retina display have been fixed, please take a look

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);
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad 😂

@pandamicro pandamicro merged commit 66659a2 into cocos2d:develop Jun 27, 2016
@ntrrgc
Copy link
Contributor

ntrrgc commented Nov 9, 2016

How is it supposed to work? setTextureRect() will overwrite the _contentSize you set in the render command object.

this._texRect.height = locSize.height;
}
var nodeW = locSize.width / pixelRatio, nodeH = locSize.height / pixelRatio;
node.setContentSize(nodeW, nodeH);
Copy link
Contributor

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...

}
this._saveStatus();
node.setTextureRect(cc.rect(0, 0, width, height));
node.setTextureRect(this._texRect);
Copy link
Contributor

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

@ntrrgc
Copy link
Contributor

ntrrgc commented Nov 9, 2016

I don't know if it's better or worse, but here is a simpler solution: #3407

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants