mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
Merge pull request #1581 from pandamicro/master
Remove dom image immediately after texture init
This commit is contained in:
@@ -974,7 +974,6 @@ var Node = cc.Class({
|
||||
}
|
||||
|
||||
if (CC_JSB) {
|
||||
this._releaseAllActions();
|
||||
if (this._touchListener) {
|
||||
this._touchListener.release();
|
||||
this._touchListener.owner = null;
|
||||
|
||||
@@ -375,7 +375,6 @@
|
||||
this._calculateTextBaseline();
|
||||
|
||||
this._updateTexture();
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -449,6 +448,8 @@
|
||||
}
|
||||
|
||||
this._texture._textureLoaded = false;
|
||||
// Hack. because we delete _htmlElementObj after usage in WEBGL mode
|
||||
this._texture._htmlElementObj = this._labelCanvas;
|
||||
this._texture.handleLoadedTexture(true);
|
||||
};
|
||||
|
||||
|
||||
@@ -838,9 +838,10 @@ game.once(game.EVENT_RENDERER_INITED, function () {
|
||||
if (!game._rendererInitialized)
|
||||
return;
|
||||
if (!self._htmlElementObj) {
|
||||
var img = cc.loader.getRes(self.url);
|
||||
if (!img) return;
|
||||
self.initWithElement(img);
|
||||
var tex = cc.loader.getRes(self.url);
|
||||
if (!tex || !tex._htmlElementObj)
|
||||
return;
|
||||
self.initWithElement(tex._htmlElementObj);
|
||||
}
|
||||
if (!self._htmlElementObj.width || !self._htmlElementObj.height)
|
||||
return;
|
||||
@@ -884,6 +885,8 @@ game.once(game.EVENT_RENDERER_INITED, function () {
|
||||
self.setAliasTexParameters();
|
||||
}
|
||||
|
||||
self._htmlElementObj = null;
|
||||
|
||||
//dispatch load event to listener.
|
||||
self.emit("load");
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user