From b47ccd2025d5a330c88840f7ae1f4c1f0a5d0e8a Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 21 Aug 2023 18:11:41 +0400 Subject: [PATCH] Up panning --- src/canvas/view/CanvasView.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/canvas/view/CanvasView.ts b/src/canvas/view/CanvasView.ts index 55ec3665c..c156500e1 100644 --- a/src/canvas/view/CanvasView.ts +++ b/src/canvas/view/CanvasView.ts @@ -182,10 +182,8 @@ export default class CanvasView extends ModuleView { const newZoom = zoom - deltaY * zoom * 0.01; module.setZoom(newZoom * 100); } else { - const diffX = deltaX / zoom; - const diffY = deltaY / zoom; - const coords = module.getCoords(); - module.setCoords(coords.x - diffX, coords.y - diffY); + const { x, y } = module.getCoords(); + module.setCoords(x - deltaX, y - deltaY); } } }