refactor(handle): naming things, cleanup

This commit is contained in:
moklick
2023-01-19 15:52:39 +01:00
parent 5af609696b
commit 66b3a8e334
6 changed files with 225 additions and 205 deletions
+2 -2
View File
@@ -114,13 +114,13 @@ function useDrag({
const yMovement = calcAutoPanVelocity(mousePosition.current.y, 35, containerBounds.current.height - 35) * 20;
if (xMovement !== 0 || yMovement !== 0) {
const { transform, movePane } = store.getState();
const { transform, panBy } = store.getState();
lastPos.current.x = (lastPos.current.x ?? 0) - xMovement / transform[2];
lastPos.current.y = (lastPos.current.y ?? 0) - yMovement / transform[2];
updateNodes(lastPos.current as XYPosition);
movePane({ x: xMovement, y: yMovement });
panBy({ x: xMovement, y: yMovement });
}
autoPanId.current = requestAnimationFrame(autoPan);
};