fix label display error for fireball/issues/6894

This commit is contained in:
knoxHuang
2018-02-12 11:25:56 +08:00
parent 992b74f0ac
commit cbafbf8a37
@@ -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);