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
|
@ -171,6 +171,7 @@ import {
|
|||
isLinearElementSimpleAndAlreadyBound,
|
||||
isBindingEnabled,
|
||||
updateBoundElements,
|
||||
shouldEnableBindingForPointerEvent,
|
||||
} from "../element/binding";
|
||||
import { MaybeTransformHandleType } from "../element/transformHandles";
|
||||
|
||||
|
@ -2220,6 +2221,7 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||
}
|
||||
|
||||
this.clearSelectionIfNotUsingSelection();
|
||||
this.updateBindingEnabledOnPointerMove(event);
|
||||
|
||||
if (this.handleSelectionOnPointerDown(event, pointerDownState)) {
|
||||
return;
|
||||
|
@ -3484,6 +3486,15 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||
});
|
||||
}
|
||||
|
||||
private updateBindingEnabledOnPointerMove = (
|
||||
event: React.PointerEvent<HTMLCanvasElement>,
|
||||
) => {
|
||||
const shouldEnableBinding = shouldEnableBindingForPointerEvent(event);
|
||||
if (this.state.isBindingEnabled !== shouldEnableBinding) {
|
||||
this.setState({ isBindingEnabled: shouldEnableBinding });
|
||||
}
|
||||
};
|
||||
|
||||
private maybeSuggestBindingAtCursor = (pointerCoords: {
|
||||
x: number;
|
||||
y: number;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue