Skip to content

Commit a14fa8a

Browse files
committed
Merge pull request cocos2d#3171 from pandamicro/develop
Fix UI deep issues
2 parents 5bb9351 + f40f72e commit a14fa8a

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

extensions/ccui/base-classes/UIScale9SpriteCanvasRenderCmd.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@
156156
locContext.setTransform(1, 0, 0, 1, 0, 0);
157157
locContext.clearRect(0, 0, sizeInPixels.width, sizeInPixels.height);
158158
cc.renderer._renderingToCacheCanvas(wrapper, node.__instanceId, locScaleFactor, locScaleFactor);
159+
cc.renderer._turnToNormalMode();
159160
if(selTexture && this._state === ccui.Scale9Sprite.state.GRAY)
160161
selTexture._switchToGray(false);
161162

@@ -173,4 +174,4 @@
173174
this._state = state;
174175
this._cacheScale9Sprite();
175176
};
176-
})();
177+
})();

extensions/ccui/uiwidgets/UIImageView.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ ccui.ImageView = ccui.Widget.extend(/** @lends ccui.ImageView# */{
5353
this._imageTextureSize = cc.size(this._capInsets.width, this._capInsets.height);
5454
ccui.Widget.prototype.ctor.call(this);
5555
texType = texType === undefined ? 0 : texType;
56-
this.init(imageFileName, texType);
56+
this._init(imageFileName, texType);
5757
},
5858

5959
/**
@@ -62,15 +62,11 @@ ccui.ImageView = ccui.Widget.extend(/** @lends ccui.ImageView# */{
6262
* @param {Number} [texType==ccui.Widget.LOCAL_TEXTURE]
6363
* @returns {boolean}
6464
*/
65-
init: function(imageFileName, texType){
66-
if(ccui.Widget.prototype.init.call(this)){
67-
if(imageFileName === undefined)
68-
this._imageTexType = ccui.Widget.LOCAL_TEXTURE;
69-
else
70-
this.loadTexture(imageFileName, texType);
71-
return true;
72-
}
73-
return false;
65+
_init: function(imageFileName, texType){
66+
if(imageFileName === undefined)
67+
this._imageTexType = ccui.Widget.LOCAL_TEXTURE;
68+
else
69+
this.loadTexture(imageFileName, texType);
7470
},
7571

7672
_initRenderer: function () {
@@ -330,4 +326,4 @@ ccui.ImageView.create = function (imageFileName, texType) {
330326
* @constant
331327
* @type {number}
332328
*/
333-
ccui.ImageView.RENDERER_ZORDER = -1;
329+
ccui.ImageView.RENDERER_ZORDER = -1;

0 commit comments

Comments
 (0)