mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Fix binding disabling when taking screenshots on macOS (#2129)
* Fix binding disabling when taking screenshots on macOS * Update snapshot for cmd+click test
This commit is contained in:
parent
924292dc9a
commit
15e4b51bb1
3 changed files with 19 additions and 1 deletions
|
@ -21,6 +21,7 @@ import { mutateElement } from "./mutateElement";
|
|||
import Scene from "../scene/Scene";
|
||||
import { LinearElementEditor } from "./linearElementEditor";
|
||||
import { tupleToCoors } from "../utils";
|
||||
import { KEYS } from "../keys";
|
||||
|
||||
export type SuggestedBinding =
|
||||
| NonDeleted<ExcalidrawBindableElement>
|
||||
|
@ -32,6 +33,12 @@ export type SuggestedPointBinding = [
|
|||
NonDeleted<ExcalidrawBindableElement>,
|
||||
];
|
||||
|
||||
export const shouldEnableBindingForPointerEvent = (
|
||||
event: React.PointerEvent<HTMLCanvasElement>,
|
||||
) => {
|
||||
return !event[KEYS.CTRL_OR_CMD];
|
||||
};
|
||||
|
||||
export const isBindingEnabled = (appState: AppState): boolean => {
|
||||
return appState.isBindingEnabled;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue