fix: remove clamping on board and component position updates for smoother dragging
parent
7f27f239dc
commit
e488bed0df
|
|
@ -294,13 +294,13 @@ export const SimulatorCanvas = () => {
|
|||
const world = toWorld(e.clientX, e.clientY);
|
||||
if (draggedComponentId === '__board__') {
|
||||
setBoardPosition({
|
||||
x: Math.max(0, world.x - dragOffset.x),
|
||||
y: Math.max(0, world.y - dragOffset.y),
|
||||
x: world.x - dragOffset.x,
|
||||
y: world.y - dragOffset.y,
|
||||
});
|
||||
} else {
|
||||
updateComponent(draggedComponentId, {
|
||||
x: Math.max(0, world.x - dragOffset.x),
|
||||
y: Math.max(0, world.y - dragOffset.y),
|
||||
x: world.x - dragOffset.x,
|
||||
y: world.y - dragOffset.y,
|
||||
} as any);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue