Archi Forum

Archi Plug-ins => jArchi => Topic started by: Gerald Groot Roessink on November 25, 2022, 19:18:20 PM

Title: retrieving x- en y coordinates for nested (visual) objects
Post by: Gerald Groot Roessink on November 25, 2022, 19:18:20 PM
Hello,

When I use the following commands for a nested object:

var x = diagramObject.bounds.x;
var y = diagramObject.bounds.y;

I will find the x- and y coordinates relative to the enveloping object.

Maybe this is intented, but I was looking voor de coordinates relative to the view.

Is that possible?
Gerald


Title: Re: retrieving x- en y coordinates for nested (visual) objects
Post by: Jean-Baptiste Sarrodie on November 25, 2022, 19:45:06 PM
Hi,

You have to compute absolute coordinates yourself by iterating through parents, until you reach the view itself.

Regards,

JB