ivmartel / dwv-jqui

Medical image viewer based on DWV (DICOM Web Viewer) and jQuery UI.
https://ivmartel.github.io/dwv-jqui/
GNU General Public License v3.0
18 stars 18 forks source link

Update coordinates when drag arrow #81

Closed gdet closed 1 year ago

gdet commented 2 years ago

Hello! I am trying to find how to update the coordinates of an arrow if you move it. In a previous post you have said that I have to find Konva group shift and add it to the Arrow. In the code of this github ("dwv-jqui") I cannot find anything about Konva except in node modules where there are konva.js and konva.min.js. Since I am not familiar with Konva and I cannot find anything in your code is very difficult for me to find a solution. Could you please help me or at least tell me how to stop the Arrow from been draggable? The only thing I found about the Arrow is in applauncher.js which I believe it doesn't have to do anything with Konva etc.

Thank you

ivmartel commented 2 years ago

The draw tool interaction code is in dwv, in src/tools/draw.js.

I'm not sure I get your use case, what coordinates are trying to update on drag?

gdet commented 2 years ago

I am using in my use case the Arrow only. When I draw it for the first time the coordinates are correct. Then if I drag the arrow to another position in the dicom image the coordinates are not updated, the coordinates stay the same as when you draw it. εικόνα

When I move/drag this arrow the coordinates x,y in the state.json are not updated.

ivmartel commented 2 years ago

Yes, each move does not change the x,y of the object but the offset of the Konva group, check out the MoveGroupCommand drawCommands.js#L129.

ivmartel commented 1 year ago

Closing for now, feel free to comment if you need.