Merge pull request #261 from cocos-creator/v0.7

merge v0.7
This commit is contained in:
Wang Nan
2016-01-18 11:50:39 +08:00
+2 -1
View File
@@ -281,12 +281,13 @@ var Texture2D = cc.Class(/** @lends cc.Texture2D# */{
*/
handleLoadedTexture: function () {
var self = this;
if (self._textureLoaded) return;
if (!self._htmlElementObj) {
var img = cc.loader.getRes(self.url);
if (!img) return;
self.initWithElement(img);
}
if (!self._htmlElementObj.width || !self._htmlElementObj.height)
return;
var locElement = self._htmlElementObj;
self._contentSize.width = locElement.width;