Skip to content

Commit

Permalink
fixed text underline/overline/linethrough not ignoring charSpacing at…
Browse files Browse the repository at this point in the history
… the end of line (fabricjs#5006) (fabricjs#5007)
  • Loading branch information
shkaper authored and asturur committed May 30, 2018
1 parent 06ce3d0 commit 5510149
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/shapes/text.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 5510149

Please sign in to comment.