diff --git a/src/hooks/useAlign.ts b/src/hooks/useAlign.ts index f5e5194..3c587af 100644 --- a/src/hooks/useAlign.ts +++ b/src/hooks/useAlign.ts @@ -442,10 +442,9 @@ export default function useAlign( nextOffsetY = tmpNextOffsetY; popupOffsetY = -popupOffsetY; - nextAlignInfo.points = [ - reversePoints(popupPoints, 0), - reversePoints(targetPoints, 0), - ]; + nextAlignInfo.points = nextAlignInfo.points.map((point) => + reversePoints(splitPoints(point), 0), + ); } else { prevFlipRef.current.bt = false; } @@ -488,10 +487,9 @@ export default function useAlign( nextOffsetY = tmpNextOffsetY; popupOffsetY = -popupOffsetY; - nextAlignInfo.points = [ - reversePoints(popupPoints, 0), - reversePoints(targetPoints, 0), - ]; + nextAlignInfo.points = nextAlignInfo.points.map((point) => + reversePoints(splitPoints(point), 0), + ); } else { prevFlipRef.current.tb = false; } @@ -541,10 +539,9 @@ export default function useAlign( nextOffsetX = tmpNextOffsetX; popupOffsetX = -popupOffsetX; - nextAlignInfo.points = [ - reversePoints(popupPoints, 1), - reversePoints(targetPoints, 1), - ]; + nextAlignInfo.points = nextAlignInfo.points.map((point) => + reversePoints(splitPoints(point), 1), + ); } else { prevFlipRef.current.rl = false; } @@ -587,10 +584,9 @@ export default function useAlign( nextOffsetX = tmpNextOffsetX; popupOffsetX = -popupOffsetX; - nextAlignInfo.points = [ - reversePoints(popupPoints, 1), - reversePoints(targetPoints, 1), - ]; + nextAlignInfo.points = nextAlignInfo.points.map((point) => + reversePoints(splitPoints(point), 1), + ); } else { prevFlipRef.current.lr = false; }