chore: renaming
This commit is contained in:
parent
ddb08ce732
commit
d1e3ea431b
@ -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({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user