fix: remove clamping on board and component position updates for smoother dragging

pull/10/head
David Montero Crespo 2026-03-08 16:35:37 -03:00
parent 7f27f239dc
commit e488bed0df
1 changed files with 4 additions and 4 deletions

View File

@ -294,13 +294,13 @@ export const SimulatorCanvas = () => {
const world = toWorld(e.clientX, e.clientY); const world = toWorld(e.clientX, e.clientY);
if (draggedComponentId === '__board__') { if (draggedComponentId === '__board__') {
setBoardPosition({ setBoardPosition({
x: Math.max(0, world.x - dragOffset.x), x: world.x - dragOffset.x,
y: Math.max(0, world.y - dragOffset.y), y: world.y - dragOffset.y,
}); });
} else { } else {
updateComponent(draggedComponentId, { updateComponent(draggedComponentId, {
x: Math.max(0, world.x - dragOffset.x), x: world.x - dragOffset.x,
y: Math.max(0, world.y - dragOffset.y), y: world.y - dragOffset.y,
} as any); } as any);
} }
} }