diff --git a/src/shapes/itext.class.js b/src/shapes/itext.class.js index 5492db10..cd244517 100644 --- a/src/shapes/itext.class.js +++ b/src/shapes/itext.class.js @@ -481,13 +481,16 @@ var cursorLocation = this.get2DCursorLocation(), lineIndex = cursorLocation.lineIndex, charIndex = cursorLocation.charIndex, - charHeight = this.getCurrentCharFontSize(lineIndex, charIndex); + charHeight = this.getCurrentCharFontSize(lineIndex, charIndex), + leftOffset = (lineIndex == 0 && charIndex == 0) + ? this._getCachedLineOffset(lineIndex, this.text.split(this._reNewline)) + : boundaries.leftOffset; ctx.fillStyle = this.getCurrentCharColor(lineIndex, charIndex); ctx.globalAlpha = this.__isMousedown ? 1 : this._currentCursorOpacity; ctx.fillRect( - boundaries.left + boundaries.leftOffset, + boundaries.left + leftOffset, boundaries.top + boundaries.topOffset, this.cursorWidth / this.scaleX, charHeight);