mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
renamed isRightClickDragging
to isRightClicked
This commit is contained in:
parent
44fada0cf6
commit
19abf76834
1 changed files with 5 additions and 5 deletions
|
@ -6712,13 +6712,13 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
public handleCanvasPan = (
|
public handleCanvasPan = (
|
||||||
event: React.PointerEvent<HTMLElement> | MouseEvent,
|
event: React.PointerEvent<HTMLElement> | MouseEvent,
|
||||||
): boolean => {
|
): boolean => {
|
||||||
const isRightClickDragging = event.button === POINTER_BUTTON.SECONDARY;
|
const isRightClicked = event.button === POINTER_BUTTON.SECONDARY;
|
||||||
if (
|
if (
|
||||||
!(
|
!(
|
||||||
gesture.pointers.size <= 1 &&
|
gesture.pointers.size <= 1 &&
|
||||||
(event.button === POINTER_BUTTON.WHEEL ||
|
(event.button === POINTER_BUTTON.WHEEL ||
|
||||||
(event.button === POINTER_BUTTON.MAIN && isHoldingSpace) ||
|
(event.button === POINTER_BUTTON.MAIN && isHoldingSpace) ||
|
||||||
isRightClickDragging ||
|
isRightClicked ||
|
||||||
isHandToolActive(this.state) ||
|
isHandToolActive(this.state) ||
|
||||||
this.state.viewModeEnabled)
|
this.state.viewModeEnabled)
|
||||||
)
|
)
|
||||||
|
@ -6746,13 +6746,13 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
? false
|
? false
|
||||||
: /Linux/.test(window.navigator.platform);
|
: /Linux/.test(window.navigator.platform);
|
||||||
|
|
||||||
if (!isRightClickDragging) {
|
if (!isRightClicked) {
|
||||||
setCursor(this.interactiveCanvas, CURSOR_TYPE.GRABBING);
|
setCursor(this.interactiveCanvas, CURSOR_TYPE.GRABBING);
|
||||||
}
|
}
|
||||||
let { clientX: lastX, clientY: lastY } = event;
|
let { clientX: lastX, clientY: lastY } = event;
|
||||||
let hasDragged = false;
|
let hasDragged = false;
|
||||||
const onPointerMove = withBatchedUpdatesThrottled((event: PointerEvent) => {
|
const onPointerMove = withBatchedUpdatesThrottled((event: PointerEvent) => {
|
||||||
if (isRightClickDragging && !hasDragged) {
|
if (isRightClicked && !hasDragged) {
|
||||||
setCursor(this.interactiveCanvas, CURSOR_TYPE.GRABBING);
|
setCursor(this.interactiveCanvas, CURSOR_TYPE.GRABBING);
|
||||||
}
|
}
|
||||||
hasDragged = true;
|
hasDragged = true;
|
||||||
|
@ -6819,7 +6819,7 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
window.removeEventListener(EVENT.POINTER_UP, teardown);
|
window.removeEventListener(EVENT.POINTER_UP, teardown);
|
||||||
window.removeEventListener(EVENT.BLUR, teardown);
|
window.removeEventListener(EVENT.BLUR, teardown);
|
||||||
onPointerMove.flush();
|
onPointerMove.flush();
|
||||||
if (!hasDragged && isRightClickDragging) {
|
if (!hasDragged && isRightClicked) {
|
||||||
this.handleCanvasContextMenu(
|
this.handleCanvasContextMenu(
|
||||||
event as React.MouseEvent<HTMLElement | HTMLCanvasElement>,
|
event as React.MouseEvent<HTMLElement | HTMLCanvasElement>,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue