From d1e3ea431b570440301904df2b04f1db847a9040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arno=C5=A1t=20Pleskot?= Date: Wed, 13 Sep 2023 16:40:39 +0200 Subject: [PATCH] chore: renaming --- src/scene/scrollConstraints.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/scene/scrollConstraints.ts b/src/scene/scrollConstraints.ts index eea06c71b5..1aff887e09 100644 --- a/src/scene/scrollConstraints.ts +++ b/src/scene/scrollConstraints.ts @@ -49,7 +49,7 @@ export const calculateConstrainedScrollCenter = ( width, height, zoom: _zoom, - cursorButton: "up", + allowOverscroll: false, }); return { @@ -98,13 +98,13 @@ const calculateConstraints = ({ width, height, zoom, - cursorButton, + allowOverscroll, }: { scrollConstraints: ScrollConstraints; width: AppState["width"]; height: AppState["height"]; zoom: AppState["zoom"]; - cursorButton: AppState["cursorButton"]; + allowOverscroll: boolean; }) => { // Set the overscroll allowance percentage const OVERSCROLL_ALLOWANCE_PERCENTAGE = 0.2; @@ -158,7 +158,7 @@ const calculateConstraints = ({ let minScrollY; // Handling the X-axis - if (cursorButton === "down") { + if (allowOverscroll) { if (shouldAdjustForCenteredViewX) { maxScrollX = constrainedScrollCenterX + overscrollAllowance; minScrollX = constrainedScrollCenterX - overscrollAllowance; @@ -179,7 +179,7 @@ const calculateConstraints = ({ } // Handling the Y-axis - if (cursorButton === "down") { + if (allowOverscroll) { if (shouldAdjustForCenteredViewY) { maxScrollY = constrainedScrollCenterY + overscrollAllowance; minScrollY = constrainedScrollCenterY - overscrollAllowance; @@ -360,7 +360,7 @@ export const constrainScrollState = ( width, height, zoom, - cursorButton: "down", + allowOverscroll: true, }); const constraintsWithoutOverscroll = canUseMemoizedValues @@ -370,7 +370,7 @@ export const constrainScrollState = ( width, height, zoom, - cursorButton: "up", + allowOverscroll: false, }); const constrainedValues = constrainScrollValues({