Only draw when one pointer is active
This commit is contained in:
+30
-27
@@ -535,7 +535,7 @@ class Draw extends PointerInteraction {
|
|||||||
event.type === MapBrowserEventType.POINTERDOWN
|
event.type === MapBrowserEventType.POINTERDOWN
|
||||||
) {
|
) {
|
||||||
pass = false;
|
pass = false;
|
||||||
} else if (move) {
|
} else if (move && this.getPointerCount() === 1) {
|
||||||
pass = event.type === MapBrowserEventType.POINTERMOVE;
|
pass = event.type === MapBrowserEventType.POINTERMOVE;
|
||||||
if (pass && this.freehand_) {
|
if (pass && this.freehand_) {
|
||||||
this.handlePointerMove_(event);
|
this.handlePointerMove_(event);
|
||||||
@@ -603,34 +603,37 @@ class Draw extends PointerInteraction {
|
|||||||
handleUpEvent(event) {
|
handleUpEvent(event) {
|
||||||
let pass = true;
|
let pass = true;
|
||||||
|
|
||||||
if (this.downTimeout_) {
|
if (this.getPointerCount() === 0) {
|
||||||
clearTimeout(this.downTimeout_);
|
if (this.downTimeout_) {
|
||||||
this.downTimeout_ = undefined;
|
clearTimeout(this.downTimeout_);
|
||||||
}
|
this.downTimeout_ = undefined;
|
||||||
|
}
|
||||||
this.handlePointerMove_(event);
|
|
||||||
|
this.handlePointerMove_(event);
|
||||||
const circleMode = this.mode_ === Mode.CIRCLE;
|
|
||||||
|
const circleMode = this.mode_ === Mode.CIRCLE;
|
||||||
if (this.shouldHandle_) {
|
|
||||||
if (!this.finishCoordinate_) {
|
if (this.shouldHandle_) {
|
||||||
this.startDrawing_(event);
|
if (!this.finishCoordinate_) {
|
||||||
if (this.mode_ === Mode.POINT) {
|
this.startDrawing_(event);
|
||||||
this.finishDrawing();
|
if (this.mode_ === Mode.POINT) {
|
||||||
}
|
this.finishDrawing();
|
||||||
} else if (this.freehand_ || circleMode) {
|
}
|
||||||
this.finishDrawing();
|
} else if (this.freehand_ || circleMode) {
|
||||||
} else if (this.atFinish_(event)) {
|
this.finishDrawing();
|
||||||
if (this.finishCondition_(event)) {
|
} else if (this.atFinish_(event)) {
|
||||||
this.finishDrawing();
|
if (this.finishCondition_(event)) {
|
||||||
}
|
this.finishDrawing();
|
||||||
} else {
|
}
|
||||||
this.addToDrawing_(event.coordinate);
|
} else {
|
||||||
|
this.addToDrawing_(event.coordinate);
|
||||||
|
}
|
||||||
|
pass = false;
|
||||||
|
} else if (this.freehand_) {
|
||||||
|
this.abortDrawing();
|
||||||
}
|
}
|
||||||
pass = false;
|
|
||||||
} else if (this.freehand_) {
|
|
||||||
this.abortDrawing();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pass && this.stopClick_) {
|
if (!pass && this.stopClick_) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user