Skip to content

Commit

Permalink
fixed single finger panning should only activate for touch
Browse files Browse the repository at this point in the history
  • Loading branch information
zsviczian committed Dec 1, 2024
1 parent 6e46a5d commit 9079fed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/excalidraw/obsidianUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,9 @@ export function isTouchInPenMode(appState: AppState, event: React.PointerEvent<H
if(!getHostPlugin().settings.penModeSingleFingerPanning) {
return false;
}
//isReactPointerEvent typecheck is here only to please typescript, else event.pointerType === "touch" should be enough
const isReactPointerEvent = 'nativeEvent' in event;
return appState.penMode &&
(!isReactPointerEvent || (event.pointerType !== "pen")) &&
(!isReactPointerEvent || (event.pointerType === "touch")) &&
![ "text" ].includes(appState.activeTool.type);
}

0 comments on commit 9079fed

Please sign in to comment.