chore: renaming

This commit is contained in:
Arnošt Pleskot
2023-09-13 16:40:39 +02:00
parent ddb08ce732
commit d1e3ea431b
+7 -7
View File
@@ -49,7 +49,7 @@ export const calculateConstrainedScrollCenter = (
width, width,
height, height,
zoom: _zoom, zoom: _zoom,
cursorButton: "up", allowOverscroll: false,
}); });
return { return {
@@ -98,13 +98,13 @@ const calculateConstraints = ({
width, width,
height, height,
zoom, zoom,
cursorButton, allowOverscroll,
}: { }: {
scrollConstraints: ScrollConstraints; scrollConstraints: ScrollConstraints;
width: AppState["width"]; width: AppState["width"];
height: AppState["height"]; height: AppState["height"];
zoom: AppState["zoom"]; zoom: AppState["zoom"];
cursorButton: AppState["cursorButton"]; allowOverscroll: boolean;
}) => { }) => {
// Set the overscroll allowance percentage // Set the overscroll allowance percentage
const OVERSCROLL_ALLOWANCE_PERCENTAGE = 0.2; const OVERSCROLL_ALLOWANCE_PERCENTAGE = 0.2;
@@ -158,7 +158,7 @@ const calculateConstraints = ({
let minScrollY; let minScrollY;
// Handling the X-axis // Handling the X-axis
if (cursorButton === "down") { if (allowOverscroll) {
if (shouldAdjustForCenteredViewX) { if (shouldAdjustForCenteredViewX) {
maxScrollX = constrainedScrollCenterX + overscrollAllowance; maxScrollX = constrainedScrollCenterX + overscrollAllowance;
minScrollX = constrainedScrollCenterX - overscrollAllowance; minScrollX = constrainedScrollCenterX - overscrollAllowance;
@@ -179,7 +179,7 @@ const calculateConstraints = ({
} }
// Handling the Y-axis // Handling the Y-axis
if (cursorButton === "down") { if (allowOverscroll) {
if (shouldAdjustForCenteredViewY) { if (shouldAdjustForCenteredViewY) {
maxScrollY = constrainedScrollCenterY + overscrollAllowance; maxScrollY = constrainedScrollCenterY + overscrollAllowance;
minScrollY = constrainedScrollCenterY - overscrollAllowance; minScrollY = constrainedScrollCenterY - overscrollAllowance;
@@ -360,7 +360,7 @@ export const constrainScrollState = (
width, width,
height, height,
zoom, zoom,
cursorButton: "down", allowOverscroll: true,
}); });
const constraintsWithoutOverscroll = canUseMemoizedValues const constraintsWithoutOverscroll = canUseMemoizedValues
@@ -370,7 +370,7 @@ export const constrainScrollState = (
width, width,
height, height,
zoom, zoom,
cursorButton: "up", allowOverscroll: false,
}); });
const constrainedValues = constrainScrollValues({ const constrainedValues = constrainScrollValues({