Archi Forum

Archi Plug-ins => jArchi => Topic started by: Cypress98 on October 10, 2023, 15:43:39 PM

Title: Object Position Behaviour ?
Post by: Cypress98 on October 10, 2023, 15:43:39 PM
Hi,

I'm putting together a series of model is Archi and I want to have a common look and feel.

To avoid positioning objects manually, I'm using a very simple jArchi script to set the size of an object and the x and y position.

selection.attr("bounds", {width: 192, height: 60} );

selection.attr("bounds", {x: 72, y: 72} );


When I put one object inside another object to show the composition relationship between the objects, the x & y co-ordinates are relative to the container\parent object.

When an object is not inside another object, the x & y co-ordinates are relative to the page.

If I move an object, so that it is not contained within another object, and then set the x & y location it is relative to the page but inside the container object.

TL;DR if I set the X & Y of an object inside another object it is offset right and down if I set the position to x=72, y = 72.  If it is not inside another object it is located where I want it to be.

Retrieving the x,y co-ordinated in both cases returns the location to be x=72, y=72.

Is there something that I'm missing to align the object when inside another object.

Thanks in Advance

Paul;
 







Title: Re: Object Position Behaviour ?
Post by: Phil Beauvoir on October 10, 2023, 15:55:53 PM
> If I move an object, so that it is not contained within another object, and then set the x & y location it is relative to the page but inside the container object.

In this case, it is not actually inside the container object as it is not a child object, the co-ordinates are relative to the page.

But, as you noticed, co-ordinates are relative to the parent object if the object is inside of another one.