mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
toggle laser in view mode on double tap
This commit is contained in:
parent
76795c7d1b
commit
25af9023d4
2 changed files with 13 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue