From 5510149fc84a2802bf229fc01f184c8047ac91ea Mon Sep 17 00:00:00 2001 From: Nick Zaitsev Date: Wed, 30 May 2018 03:52:16 -0300 Subject: [PATCH] fixed text underline/overline/linethrough not ignoring charSpacing at the end of line (#5006) (#5007) --- src/shapes/text.class.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/shapes/text.class.js b/src/shapes/text.class.js index 19bf49de3b4..190a222a4dc 100644 --- a/src/shapes/text.class.js +++ b/src/shapes/text.class.js @@ -1138,7 +1138,8 @@ leftOffset = this._getLeftOffset(), topOffset = this._getTopOffset(), top, boxStart, boxWidth, charBox, currentDecoration, - maxHeight, currentFill, lastFill; + maxHeight, currentFill, lastFill, + charSpacing = this._getWidthOfCharSpacing(); for (var i = 0, len = this._textLines.length; i < len; i++) { heightOfLine = this.getHeightOfLine(i); @@ -1186,7 +1187,7 @@ currentDecoration && currentFill && ctx.fillRect( leftOffset + lineLeftOffset + boxStart, top + this.offsets[type] * size + dy, - boxWidth, + boxWidth - charSpacing, this.fontSize / 15 ); topOffset += heightOfLine;