Merge pull request #2332 from knoxHuang/fix_bug

fix label display error for fireball/issues/6894
This commit is contained in:
pandamicro
2018-02-12 12:48:09 +08:00
committed by GitHub
@@ -288,8 +288,8 @@
}
canvasSizeY = this._splitedStrings.length * this._getLineHeight();
this._canvasSize.width = parseFloat(canvasSizeX.toFixed(2)) + 2 * this._getMargin();
this._canvasSize.height = parseFloat(canvasSizeY.toFixed(2));
this._canvasSize.width = Math.round(canvasSizeX.toFixed(2)) + 2 * this._getMargin();
this._canvasSize.height = Math.round(canvasSizeY.toFixed(2));
if(node._isItalic) {
//0.0174532925 = 3.141592653 / 180
this._canvasSize.width += node._drawFontsize * Math.tan(12 * 0.0174532925);