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);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue