guide line and magnet

This commit is contained in:
hamid zarghami
2026-04-26 10:50:22 +03:30
parent e2b7e964cd
commit 4feccbf1f9
5 changed files with 335 additions and 17 deletions
@@ -48,11 +48,8 @@ const RectangleShape = ({ obj, isSelected, onSelect, onUpdate, draggable }: Shap
}
}}
onDragMove={(e) => {
const node = e.target;
onUpdate(obj.id, {
x: node.x(),
y: node.y(),
});
// Snapping is applied at Stage level, avoid store updates per frame.
e.target.getLayer()?.batchDraw();
}}
onDragEnd={(e) => {
const node = e.target;