Skip to content

Commit 805e359

Browse files
committed
Merge pull request cocos2d#2262 from VisualSJ/5936-Scale9Sprite
Issue #5936: Scale9Sprite - Effect of canvas and webgl mode is not the s...
2 parents 191aa99 + 383fb39 commit 805e359

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

extensions/gui/control-extension/CCScale9Sprite.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,8 +961,12 @@ cc.Scale9Sprite = cc.Node.extend(/** @lends cc.Scale9Sprite# */{
961961
}
962962

963963
this.setContentSize(rect.width, rect.height);
964-
if(cc._renderType === cc._RENDER_TYPE_WEBGL)
964+
if(cc._renderType === cc._RENDER_TYPE_WEBGL){
965965
this.addChild(locScale9Image);
966+
}else{
967+
if(!this._cacheSprite.getParent())
968+
this.addChild(this._cacheSprite);
969+
}
966970

967971
if (this._spritesGenerated) {
968972
// Restore color and opacity

0 commit comments

Comments
 (0)