fix resize
This commit is contained in:
@@ -58,26 +58,6 @@ const AbstractShape = ({ obj, isSelected, onSelect, onUpdate, draggable }: Shape
|
||||
y: node.y() - (obj.height || 100) / 2,
|
||||
});
|
||||
}}
|
||||
onTransformEnd={() => {
|
||||
const node = shapeRef.current;
|
||||
if (!node) return;
|
||||
|
||||
const scaleX = node.scaleX();
|
||||
const scaleY = node.scaleY();
|
||||
|
||||
node.scaleX(1);
|
||||
node.scaleY(1);
|
||||
|
||||
const newRadius = Math.max(5, baseRadius * Math.min(scaleX, scaleY));
|
||||
const newSize = newRadius * 2;
|
||||
onUpdate(obj.id, {
|
||||
x: node.x() - newSize / 2,
|
||||
y: node.y() - newSize / 2,
|
||||
rotation: node.rotation(),
|
||||
width: newSize,
|
||||
height: newSize,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user