Call Draw finishCondition for every type
This commit is contained in:
+15
-14
@@ -625,22 +625,23 @@ class Draw extends PointerInteraction {
|
|||||||
this.handlePointerMove_(event);
|
this.handlePointerMove_(event);
|
||||||
|
|
||||||
if (this.shouldHandle_) {
|
if (this.shouldHandle_) {
|
||||||
switch (true) {
|
const startingToDraw = !this.finishCoordinate_;
|
||||||
case !this.finishCoordinate_:
|
if (startingToDraw) {
|
||||||
this.startDrawing_(event.coordinate);
|
this.startDrawing_(event.coordinate);
|
||||||
if (this.mode_ !== Mode.POINT) {
|
}
|
||||||
break;
|
if (!startingToDraw && this.freehand_) {
|
||||||
|
this.finishDrawing();
|
||||||
|
} else if (
|
||||||
|
!this.freehand_ &&
|
||||||
|
(!startingToDraw || this.mode_ === Mode.POINT)
|
||||||
|
) {
|
||||||
|
if (this.atFinish_(event.pixel)) {
|
||||||
|
if (this.finishCondition_(event)) {
|
||||||
|
this.finishDrawing();
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line no-fallthrough
|
} else {
|
||||||
case this.freehand_ ||
|
|
||||||
(this.atFinish_(event.pixel) && this.finishCondition_(event)):
|
|
||||||
this.finishDrawing();
|
|
||||||
break;
|
|
||||||
case !this.freehand_:
|
|
||||||
this.addToDrawing_(event.coordinate);
|
this.addToDrawing_(event.coordinate);
|
||||||
break;
|
}
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
pass = false;
|
pass = false;
|
||||||
} else if (this.freehand_) {
|
} else if (this.freehand_) {
|
||||||
|
|||||||
Reference in New Issue
Block a user