Compare commits
3 Commits
master
...
zsviczian-
Author | SHA1 | Date | |
---|---|---|---|
![]() |
85ebc4e2f1 | ||
![]() |
c79bb5ed6a | ||
![]() |
6ef88eb851 |
@ -370,7 +370,11 @@ import {
|
|||||||
actionRemoveAllElementsFromFrame,
|
actionRemoveAllElementsFromFrame,
|
||||||
actionSelectAllElementsInFrame,
|
actionSelectAllElementsInFrame,
|
||||||
} from "../actions/actionFrame";
|
} from "../actions/actionFrame";
|
||||||
import { actionToggleHandTool, zoomToFit } from "../actions/actionCanvas";
|
import {
|
||||||
|
actionToggleEraserTool,
|
||||||
|
actionToggleHandTool,
|
||||||
|
zoomToFit,
|
||||||
|
} from "../actions/actionCanvas";
|
||||||
import { jotaiStore } from "../jotai";
|
import { jotaiStore } from "../jotai";
|
||||||
import { activeConfirmDialogAtom } from "./ActiveConfirmDialog";
|
import { activeConfirmDialogAtom } from "./ActiveConfirmDialog";
|
||||||
import { ImageSceneDataError } from "../errors";
|
import { ImageSceneDataError } from "../errors";
|
||||||
@ -4867,6 +4871,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private debounceDoubleClickTimestamp: number = 0;
|
||||||
private handleCanvasDoubleClick = (
|
private handleCanvasDoubleClick = (
|
||||||
event: React.MouseEvent<HTMLCanvasElement>,
|
event: React.MouseEvent<HTMLCanvasElement>,
|
||||||
) => {
|
) => {
|
||||||
@ -4875,6 +4880,23 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
if (this.state.multiElement) {
|
if (this.state.multiElement) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
this.state.penMode &&
|
||||||
|
this.lastPointerDownEvent?.pointerType === "touch" &&
|
||||||
|
this.state.activeTool.type !== "selection"
|
||||||
|
) {
|
||||||
|
const now = Date.now();
|
||||||
|
if (now - this.debounceDoubleClickTimestamp < 200) {
|
||||||
|
//handleCanvasDoubleClick click fires twice in case of touch.
|
||||||
|
//Once from the onTouchStart event handler, once from the double click event handler
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.debounceDoubleClickTimestamp = now;
|
||||||
|
this.updateScene(actionToggleEraserTool.perform([] as any, this.state));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// we should only be able to double click when mode is selection
|
// we should only be able to double click when mode is selection
|
||||||
if (this.state.activeTool.type !== "selection") {
|
if (this.state.activeTool.type !== "selection") {
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user