From 1a3f138f6bb11e7d9bd335763b708490d77ec183 Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Thu, 10 Mar 2022 19:40:40 +0200 Subject: [PATCH] lint + rename --- src/mixins/itext_behavior.mixin.js | 16 ++++++++-------- src/mixins/itext_key_behavior.mixin.js | 22 +++++++++++----------- src/shapes/text.class.js | 4 ++-- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/mixins/itext_behavior.mixin.js b/src/mixins/itext_behavior.mixin.js index 2a51e3c96ff..f50d1f67246 100644 --- a/src/mixins/itext_behavior.mixin.js +++ b/src/mixins/itext_behavior.mixin.js @@ -189,15 +189,15 @@ }, /** - * - * @param {'left'|'right'} from - * @param {number} startFrom + * + * @param {'left'|'right'} from + * @param {number} startFrom * @return {number} New selection index */ findWordBoundary: function (from, startFrom) { return from === 'right' ? this.findWordBoundaryRight(startFrom) : - this.findWordBoundaryLeft(startFrom) + this.findWordBoundaryLeft(startFrom); }, /** @@ -247,15 +247,15 @@ }, /** - * - * @param {'left'|'right'} from - * @param {number} startFrom + * + * @param {'left'|'right'} from + * @param {number} startFrom * @return {number} New selection index */ findLineBoundary: function (from, startFrom) { return from === 'right' ? this.findLineBoundaryRight(startFrom) : - this.findLineBoundaryLeft(startFrom) + this.findLineBoundaryLeft(startFrom); }, /** diff --git a/src/mixins/itext_key_behavior.mixin.js b/src/mixins/itext_key_behavior.mixin.js index 00a7369fb76..fdc907ad82e 100644 --- a/src/mixins/itext_key_behavior.mixin.js +++ b/src/mixins/itext_key_behavior.mixin.js @@ -57,11 +57,11 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot 27: 'exitEditing', 33: 'moveCursorUp', 34: 'moveCursorDown', - 35: 'moveCursorRight', - 36: 'moveCursorLeft', - 37: 'moveCursorLeft', + 35: 'moveCursorEndDir', + 36: 'moveCursorStartDir', + 37: 'moveCursorStartDir', 38: 'moveCursorUp', - 39: 'moveCursorRight', + 39: 'moveCursorEndDir', 40: 'moveCursorDown', }, @@ -70,11 +70,11 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot 27: 'exitEditing', 33: 'moveCursorUp', 34: 'moveCursorDown', - 35: 'moveCursorLeft', - 36: 'moveCursorRight', - 37: 'moveCursorRight', + 35: 'moveCursorStartDir', + 36: 'moveCursorEndDir', + 37: 'moveCursorEndDir', 38: 'moveCursorUp', - 39: 'moveCursorLeft', + 39: 'moveCursorStartDir', 40: 'moveCursorDown', }, @@ -497,7 +497,7 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot * Moves cursor left * @param {Event} e Event object */ - moveCursorLeft: function(e) { + moveCursorStartDir: function (e) { if (this.selectionStart === 0 && this.selectionEnd === 0) { return; } @@ -528,7 +528,7 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot * Moves cursor right * @param {Event} e Event object */ - moveCursorRight: function (e) { + moveCursorEndDir: function (e) { if (this.selectionStart >= this._text.length && this.selectionEnd >= this._text.length) { return; } @@ -557,7 +557,7 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot /** * @private - * @param {boolean} dirty + * @param {boolean} dirty */ _invalidateCursor: function (dirty) { this._currentCursorOpacity = 1; diff --git a/src/shapes/text.class.js b/src/shapes/text.class.js index 46461e600c8..c2f5646432d 100644 --- a/src/shapes/text.class.js +++ b/src/shapes/text.class.js @@ -380,8 +380,8 @@ }, /** - * - * @param {boolean} rtl + * + * @param {boolean} rtl * @param {TextAlign} [textAlign] * @returns {TextAlign} */