mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-27 00:44:41 +00:00
Update itext_behavior.mixin.js
This commit is contained in:
parent
dda96f9b81
commit
57329b39be
1 changed files with 22 additions and 19 deletions
|
|
@ -342,28 +342,31 @@
|
|||
|
||||
this._tick();
|
||||
this.fire('editing:entered');
|
||||
if (this.canvas) {
|
||||
var _this = this;
|
||||
this.canvas.renderAll();
|
||||
this.canvas.fire('text:editing:entered', { target: this });
|
||||
this.canvas.on('mouse:move', function(options) {
|
||||
|
||||
if (!_this.__isMousedown || !_this.isEditing) {
|
||||
return;
|
||||
}
|
||||
|
||||
var newSelectionStart = _this.getSelectionStartFromPointer(options.e);
|
||||
if (newSelectionStart >= _this.__selectionStartOnMouseDown) {
|
||||
_this.setSelectionStart(_this.__selectionStartOnMouseDown);
|
||||
_this.setSelectionEnd(newSelectionStart);
|
||||
}
|
||||
else {
|
||||
_this.setSelectionStart(newSelectionStart);
|
||||
_this.setSelectionEnd(_this.__selectionStartOnMouseDown);
|
||||
}
|
||||
});
|
||||
if (!this.canvas) {
|
||||
return this;
|
||||
}
|
||||
|
||||
var _this = this;
|
||||
this.canvas.renderAll();
|
||||
this.canvas.fire('text:editing:entered', { target: this });
|
||||
this.canvas.on('mouse:move', function(options) {
|
||||
|
||||
if (!_this.__isMousedown || !_this.isEditing) {
|
||||
return;
|
||||
}
|
||||
|
||||
var newSelectionStart = _this.getSelectionStartFromPointer(options.e);
|
||||
if (newSelectionStart >= _this.__selectionStartOnMouseDown) {
|
||||
_this.setSelectionStart(_this.__selectionStartOnMouseDown);
|
||||
_this.setSelectionEnd(newSelectionStart);
|
||||
}
|
||||
else {
|
||||
_this.setSelectionStart(newSelectionStart);
|
||||
_this.setSelectionEnd(_this.__selectionStartOnMouseDown);
|
||||
}
|
||||
});
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue