mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
fix double click
This commit is contained in:
parent
8201fd09b8
commit
88bf26b4b9
@ -529,6 +529,7 @@
|
||||
this._setPointerPosition(evt);
|
||||
var shape = this.getIntersection(this.getPointerPosition()),
|
||||
clickStartShape = this.clickStartShape,
|
||||
clickEndShape = this.clickEndShape,
|
||||
fireDblClick = false,
|
||||
dd = Konva.DD;
|
||||
|
||||
@ -547,6 +548,7 @@
|
||||
}, Konva.dblClickWindow);
|
||||
|
||||
if (shape && shape.isListening()) {
|
||||
this.clickEndShape = shape;
|
||||
shape._fireAndBubble(MOUSEUP, { evt: evt });
|
||||
|
||||
// detect if click or double click occurred
|
||||
@ -557,7 +559,11 @@
|
||||
) {
|
||||
shape._fireAndBubble(CLICK, { evt: evt });
|
||||
|
||||
if (fireDblClick) {
|
||||
if (
|
||||
fireDblClick &&
|
||||
clickEndShape &&
|
||||
clickEndShape._id === shape._id
|
||||
) {
|
||||
shape._fireAndBubble(DBL_CLICK, { evt: evt });
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user