mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
Merge pull request #187 from dabingnn/v0.7fixSpriteContentSizeJSB
V0.7fix sprite content size jsb
This commit is contained in:
@@ -1276,3 +1276,12 @@ cc.Scale9Sprite.prototype.setAnchorPoint = function(anchorPoint, y){
|
||||
}
|
||||
this._setAnchorPoint(anchorPoint);
|
||||
};
|
||||
|
||||
cc.Scale9Sprite.prototype._setSpriteFrame = cc.Scale9Sprite.prototype.setSpriteFrame;
|
||||
cc.Scale9Sprite.prototype.setSpriteFrame = function(spriteFrame) {
|
||||
var contentSize = this.getContentSize();
|
||||
this._setSpriteFrame(spriteFrame);
|
||||
if (!cc.sizeEqualToSize(contentSize, cc.size(0, 0))) {
|
||||
this.setContentSize(contentSize);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user