toggle laser in view mode on double tap

This commit is contained in:
zsviczian 2023-10-07 11:54:22 +00:00
parent 76795c7d1b
commit 25af9023d4
2 changed files with 13 additions and 3 deletions

View File

@ -3623,6 +3623,18 @@ class App extends React.Component<AppProps, AppState> {
if (this.state.multiElement) {
return;
}
if (this.state.viewModeEnabled) {
if (this.state.activeTool.type === "laser") {
this.setActiveTool({ type: "selection" });
setCursor(this.interactiveCanvas, CURSOR_TYPE.GRAB);
} else {
this.setActiveTool({ type: "laser" });
setCursor(this.interactiveCanvas, CURSOR_TYPE.CROSSHAIR);
}
return;
}
// we should only be able to double click when mode is selection
if (this.state.activeTool.type !== "selection") {
return;

View File

@ -155,9 +155,7 @@ const InteractiveCanvas = (props: InteractiveCanvasProps) => {
onPointerCancel={props.onPointerCancel}
onTouchMove={props.onTouchMove}
onPointerDown={props.onPointerDown}
onDoubleClick={
props.appState.viewModeEnabled ? undefined : props.onDoubleClick
}
onDoubleClick={props.onDoubleClick}
>
{t("labels.drawingCanvas")}
</canvas>