changed logic to match regression tests

This commit is contained in:
zsviczian 2024-05-23 18:02:05 +00:00
parent 6ef88eb851
commit c79bb5ed6a

View File

@ -4881,6 +4881,11 @@ class App extends React.Component<AppProps, AppState> {
return; return;
} }
if (
this.state.penMode &&
this.lastPointerDownEvent?.pointerType === "touch" &&
this.state.activeTool.type !== "selection"
) {
const now = Date.now(); const now = Date.now();
if (now - this.debounceDoubleClickTimestamp < 200) { if (now - this.debounceDoubleClickTimestamp < 200) {
//handleCanvasDoubleClick click fires twice in case of touch. //handleCanvasDoubleClick click fires twice in case of touch.
@ -4888,12 +4893,6 @@ class App extends React.Component<AppProps, AppState> {
return; return;
} }
this.debounceDoubleClickTimestamp = now; this.debounceDoubleClickTimestamp = now;
if (
this.state.penMode &&
this.lastPointerDownEvent?.pointerType === "touch" &&
this.state.activeTool.type !== "selection"
) {
this.updateScene(actionToggleEraserTool.perform([] as any, this.state)); this.updateScene(actionToggleEraserTool.perform([] as any, this.state));
return; return;
} }