fix label display error for fireball/issues/7233

This commit is contained in:
knox
2018-05-09 15:39:12 +08:00
parent 9e690f0fe1
commit 904ea1056a
2 changed files with 7 additions and 2 deletions
@@ -448,8 +448,7 @@
this._texture.loaded = false;
// Hack. because we delete _image after usage in WEBGL mode
this._texture._image = this._labelCanvas;
this._texture.handleLoadedTexture(true);
this._texture._nativeAsset = this._labelCanvas;
};
proto._getGradientArgs = function () {
@@ -31,12 +31,18 @@
http://www.angelcode.com/products/bmfont/ (Free, Windows only)
****************************************************************************/
//
var opts = {
premultiplyAlpha: true
};
var _sharedLabelCanvas;
_ccsg.Label.WebGLRenderCmd = function(renderableObject){
this._rootCtor(renderableObject);
this._needDraw = true;
this._texture = new cc.Texture2D();
this._texture.update(opts);
_sharedLabelCanvas = _sharedLabelCanvas || document.createElement('canvas');
this._labelCanvas = _sharedLabelCanvas;
this._texture.initWithElement(this._labelCanvas);