fix: Pinch zoom in view mode (#5001)

This commit is contained in:
zsviczian 2022-04-12 12:39:28 +02:00 committed by GitHub
parent 5359e4fec9
commit bf6d0eeef7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2937,6 +2937,8 @@ class App extends React.Component<AppProps, AppState> {
}); });
this.savePointer(event.clientX, event.clientY, "down"); this.savePointer(event.clientX, event.clientY, "down");
this.updateGestureOnPointerDown(event);
if (this.handleCanvasPanUsingWheelOrSpaceDrag(event)) { if (this.handleCanvasPanUsingWheelOrSpaceDrag(event)) {
return; return;
} }
@ -2949,8 +2951,6 @@ class App extends React.Component<AppProps, AppState> {
return; return;
} }
this.updateGestureOnPointerDown(event);
// don't select while panning // don't select while panning
if (gesture.pointers.size > 1) { if (gesture.pointers.size > 1) {
return; return;
@ -3128,7 +3128,7 @@ class App extends React.Component<AppProps, AppState> {
): boolean => { ): boolean => {
if ( if (
!( !(
gesture.pointers.size === 0 && 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) ||
this.state.viewModeEnabled) this.state.viewModeEnabled)