mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-03-16 22:10:32 +00:00
Merge pull request #1532 from boonkerz/patch-1
Update to Fix select text in itext last letter issue #1429
This commit is contained in:
commit
6769228d18
1 changed files with 2 additions and 6 deletions
|
|
@ -239,7 +239,7 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
|
|||
|
||||
if (mouseOffset.y < height) {
|
||||
return this._getNewSelectionStartFromOffset(
|
||||
mouseOffset, prevWidth, width, charIndex + i, jlen, j);
|
||||
mouseOffset, prevWidth, width, charIndex + i, jlen);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -252,7 +252,7 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
|
|||
/**
|
||||
* @private
|
||||
*/
|
||||
_getNewSelectionStartFromOffset: function(mouseOffset, prevWidth, width, index, jlen, j) {
|
||||
_getNewSelectionStartFromOffset: function(mouseOffset, prevWidth, width, index, jlen) {
|
||||
|
||||
var distanceBtwLastCharAndCursor = mouseOffset.x - prevWidth,
|
||||
distanceBtwNextCharAndCursor = width - mouseOffset.x,
|
||||
|
|
@ -268,10 +268,6 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
|
|||
newSelectionStart = this.text.length;
|
||||
}
|
||||
|
||||
if (j === jlen) {
|
||||
newSelectionStart--;
|
||||
}
|
||||
|
||||
return newSelectionStart;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue