mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
fix label display error for fireball/issues/7233
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user