fix error
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user