Skip to content

Commit

Permalink
feat(update): minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mgcrea committed Nov 22, 2024
1 parent 225d520 commit 06744f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/features/sort/hooks/useDraggableGrid.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type FlexStyle } from "react-native";
import { useAnimatedReaction } from "react-native-reanimated";
import { doesCenterOverlap } from "../../../utils";
import { doesCenterPointOverlap } from "../../../utils";
import { useDndContext } from "./../../../DndContext";
import { useDraggableSort, type UseDraggableSortOptions } from "./useDraggableSort";

Expand All @@ -20,7 +20,7 @@ export const useDraggableGrid = ({
gap = 0,
size,
direction = "row",
shouldSwapWorklet = doesCenterOverlap,
shouldSwapWorklet = doesCenterPointOverlap,
}: UseDraggableGridOptions) => {
const { draggableActiveId, draggableOffsets, draggableRestingOffsets, draggableLayouts } = useDndContext();
const horizontal = ["row", "row-reverse"].includes(direction);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/collision.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { centerAxis, centerPoint, Direction, includesPoint, overlapsAxis, type Rectangle } from "./geometry";

export const doesCenterOverlap = (activeLayout: Rectangle, itemLayout: Rectangle) => {
export const doesCenterPointOverlap = (activeLayout: Rectangle, itemLayout: Rectangle) => {
"worklet";
const itemCenterPoint = centerPoint(itemLayout);
return includesPoint(activeLayout, itemCenterPoint);
Expand Down

0 comments on commit 06744f7

Please sign in to comment.