react-konva
react-konva copied to clipboard
[Info] Placing draggable elements inside Group using Stage coordinate and not Group coordinates
Hello,
I started using React-Konva just 1 week ago, and I found it awesome. Actually I have a problem in what I am doing and I can't figure it out due my lack of knowledge of Konva.
I have aStage
, with Layer
and Group
inside.
Inside the Group
I have a Rect
and some data from an api that places some Image
on the screen.
Actually I can move the Group
, and I want that when I move it, all elements inside it move together, which actually works great.
I can resize the Rect
, and what I am trying to do is to place the Image
elements with absolute x,y
(of the stage), instead I don't know why, the images are place on the stage taking into account the coordinates of the Rect/Group
.
Is there a way to place the images (inside the group) using the stage area coordinates instead of the Rect/Group
coordinates.
Actually when I resize the Rect
, saving width, height,x and y
to backend, and then reload or re-enter the page, I see that the Rect
is resized correctly, but all the Image
elements are shifted from left because their x, y
are relative to Rect/Group
and not the Stage