mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 15:23:44 +08:00
resizer fixes
This commit is contained in:
parent
310004337d
commit
a9ab965bb0
13
konva.js
13
konva.js
@ -18240,7 +18240,7 @@
|
|||||||
attachTo: function(node) {
|
attachTo: function(node) {
|
||||||
this._el = node;
|
this._el = node;
|
||||||
this._update();
|
this._update();
|
||||||
this._el.on('dragmove', this._update);
|
this._el.on('dragmove.resizer', this._update);
|
||||||
// this._set();
|
// this._set();
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -18284,6 +18284,9 @@
|
|||||||
});
|
});
|
||||||
anchor.on('mouseout', function() {
|
anchor.on('mouseout', function() {
|
||||||
var layer = this.getLayer();
|
var layer = this.getLayer();
|
||||||
|
if (!layer) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
document.body.style.cursor = 'default';
|
document.body.style.cursor = 'default';
|
||||||
this.setStrokeWidth(1);
|
this.setStrokeWidth(1);
|
||||||
layer.draw();
|
layer.draw();
|
||||||
@ -18553,6 +18556,14 @@
|
|||||||
x: width / 2,
|
x: width / 2,
|
||||||
y: -50
|
y: -50
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
destroy: function() {
|
||||||
|
Konva.Group.prototype.destroy.call(this);
|
||||||
|
this._el.off('.resizer');
|
||||||
|
window.removeEventListener('mousemove', this.handleMouseMove);
|
||||||
|
window.removeEventListener('touchmove', this.handleMouseMove);
|
||||||
|
window.removeEventListener('mouseup', this.handleMouseUp);
|
||||||
|
window.removeEventListener('touchend', this.handleMouseUp);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Konva.Util.extend(Konva.Resizer, Konva.Group);
|
Konva.Util.extend(Konva.Resizer, Konva.Group);
|
||||||
|
4
konva.min.js
vendored
4
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@ -19,7 +19,7 @@
|
|||||||
attachTo: function(node) {
|
attachTo: function(node) {
|
||||||
this._el = node;
|
this._el = node;
|
||||||
this._update();
|
this._update();
|
||||||
this._el.on('dragmove', this._update);
|
this._el.on('dragmove.resizer', this._update);
|
||||||
// this._set();
|
// this._set();
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -63,6 +63,9 @@
|
|||||||
});
|
});
|
||||||
anchor.on('mouseout', function() {
|
anchor.on('mouseout', function() {
|
||||||
var layer = this.getLayer();
|
var layer = this.getLayer();
|
||||||
|
if (!layer) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
document.body.style.cursor = 'default';
|
document.body.style.cursor = 'default';
|
||||||
this.setStrokeWidth(1);
|
this.setStrokeWidth(1);
|
||||||
layer.draw();
|
layer.draw();
|
||||||
@ -332,6 +335,14 @@
|
|||||||
x: width / 2,
|
x: width / 2,
|
||||||
y: -50
|
y: -50
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
destroy: function() {
|
||||||
|
Konva.Group.prototype.destroy.call(this);
|
||||||
|
this._el.off('.resizer');
|
||||||
|
window.removeEventListener('mousemove', this.handleMouseMove);
|
||||||
|
window.removeEventListener('touchmove', this.handleMouseMove);
|
||||||
|
window.removeEventListener('mouseup', this.handleMouseUp);
|
||||||
|
window.removeEventListener('touchend', this.handleMouseUp);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Konva.Util.extend(Konva.Resizer, Konva.Group);
|
Konva.Util.extend(Konva.Resizer, Konva.Group);
|
||||||
|
Loading…
Reference in New Issue
Block a user