fix error

This commit is contained in:
Haapy
2026-05-14 22:08:14 +00:00
parent fe9f3681fd
commit a858a3415d
3 changed files with 7 additions and 6 deletions

View File

@@ -80,10 +80,11 @@ export function Canvas({ initialCards }: CanvasProps) {
};
const onPointerMove = (e: React.PointerEvent) => {
if (!panState.current) return;
const dx = e.clientX - panState.current.startX;
const dy = e.clientY - panState.current.startY;
setVp((prev) => ({ ...prev, x: panState.current!.vpX + dx, y: panState.current!.vpY + dy }));
const ps = panState.current;
if (!ps) return;
const newX = ps.vpX + (e.clientX - ps.startX);
const newY = ps.vpY + (e.clientY - ps.startY);
setVp((prev) => ({ ...prev, x: newX, y: newY }));
};
const onPointerUp = (e: React.PointerEvent) => {