image section

This commit is contained in:
hamid zarghami
2025-12-04 09:34:04 +03:30
parent 2c28218488
commit 26d3bd26ab
7 changed files with 292 additions and 27 deletions
@@ -16,17 +16,18 @@ const ImageObject = ({
const shapeRef = useRef<Konva.Image>(null);
useEffect(() => {
if (isSelected && shapeRef.current && transformerRef.current) {
if (isSelected && shapeRef.current && transformerRef.current && image) {
transformerRef.current.nodes([shapeRef.current]);
transformerRef.current.getLayer()?.batchDraw();
}
}, [isSelected, transformerRef]);
}, [isSelected, transformerRef, image]);
if (!image) return null;
return (
<KonvaImage
ref={shapeRef}
id={obj.id}
x={obj.x}
y={obj.y}
image={image}