From b89bc018473f7de3181e7de1e5902ebdbc35ee4a Mon Sep 17 00:00:00 2001 From: Andrea Bogazzi Date: Sun, 1 Mar 2015 19:05:50 +0100 Subject: [PATCH] Fix misplacement of some iText --- src/shapes/itext.class.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shapes/itext.class.js b/src/shapes/itext.class.js index 90a865fb..7d5101fd 100644 --- a/src/shapes/itext.class.js +++ b/src/shapes/itext.class.js @@ -736,7 +736,9 @@ _renderTextLine: function(method, ctx, line, left, top, lineIndex) { // to "cancel" this.fontSize subtraction in fabric.Text#_renderTextLine // the adding 0.03 is just to align text with itext by overlap test - top += this.fontSize * (this._fontSizeFraction + 0.03); + if (!this.isEmptyStyles()) { + top += this.fontSize * (this._fontSizeFraction + 0.03); + } this.callSuper('_renderTextLine', method, ctx, line, left, top, lineIndex); },