fixed text underline/overline/linethrough not ignoring charSpacing at the end of line (#5006) (#5007)

This commit is contained in:
Nick Zaitsev 2018-05-30 03:52:16 -03:00 committed by Andrea Bogazzi
parent c7607c8d16
commit b1c25a4f56

View file

@ -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;