Compare commits
3 Commits
master
...
zsviczian-
Author | SHA1 | Date | |
---|---|---|---|
![]() |
85ebc4e2f1 | ||
![]() |
c79bb5ed6a | ||
![]() |
6ef88eb851 |
@ -370,7 +370,11 @@ import {
|
||||
actionRemoveAllElementsFromFrame,
|
||||
actionSelectAllElementsInFrame,
|
||||
} from "../actions/actionFrame";
|
||||
import { actionToggleHandTool, zoomToFit } from "../actions/actionCanvas";
|
||||
import {
|
||||
actionToggleEraserTool,
|
||||
actionToggleHandTool,
|
||||
zoomToFit,
|
||||
} from "../actions/actionCanvas";
|
||||
import { jotaiStore } from "../jotai";
|
||||
import { activeConfirmDialogAtom } from "./ActiveConfirmDialog";
|
||||
import { ImageSceneDataError } from "../errors";
|
||||
@ -4867,6 +4871,7 @@ class App extends React.Component<AppProps, AppState> {
|
||||
});
|
||||
};
|
||||
|
||||
private debounceDoubleClickTimestamp: number = 0;
|
||||
private handleCanvasDoubleClick = (
|
||||
event: React.MouseEvent<HTMLCanvasElement>,
|
||||
) => {
|
||||
@ -4875,6 +4880,23 @@ class App extends React.Component<AppProps, AppState> {
|
||||
if (this.state.multiElement) {
|
||||
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
|
||||
if (this.state.activeTool.type !== "selection") {
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user