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
@@ -255,11 +255,8 @@ const ObjectRenderer = ({
}
}}
onDragMove={(e) => {
const node = e.target;
onUpdate(obj.id, {
x: node.x(),
y: node.y(),
});
// Snapping is handled at Stage level for smoother dragging.
e.target.getLayer()?.batchDraw();
}}
onDragEnd={(e) => {
const node = e.target;
@@ -308,10 +305,6 @@ const ObjectRenderer = ({
const handleGroupDragMove = (e: Konva.KonvaEventObject<DragEvent>) => {
const node = e.target;
onUpdate(obj.id, {
x: node.x(),
y: node.y(),
});
// به‌روزرسانی transformer در حین drag
if (transformerRef.current && isSelected) {
transformerRef.current.nodes([node]);