Sg2.9
rectangle.topLeft & bottomLeft
Recent RSS
rectangle.topLeft & bottomLeft
Date:  27. November 2007, 03:04

I think the two are confused.

Here I am moving art2 to the same postion as art1, using rectangle coordinates of art1:
http://www.scriptographer.com/Reference/ai/Rectangle/

art2.translate(art1.geometricBounds.bottomLeft);

does the same job as

art2.translate(Point(art1.geometricBounds.left, art1.geometricBounds.top));
!

And on the opposite, art2.translate(art1.geometricBounds.topLeft);
actually moves art2 to the bottomLeft of art1.

Can you confirm this?

Re: rectangle.topLeft & bottomLeft
Date:  27. November 2007, 10:18

forgot to mention something, art2 which is moved is actually a group, and it seems translating the group happens by the first object which has been created in this group (most below), i.e. it uses the first object for the whole groups new top left corner coordinates, so you get different results if the rest of the group is >geometrically< below or above or to the left or to the right of the first object, .... it seems

Re: rectangle.topLeft & bottomLeft
Date:  27. November 2007, 20:49

translate doesn't mean 'move to', but 'move by'

try:

art2.translate(art2.bounds.bottomLeft.multiply(-1).add(art1.bounds.bottomLeft));
Re: rectangle.topLeft & bottomLeft
From:  kveldulfr (drgs)
Date:  27. November 2007, 21:30

sorry i was using an old version of scriptographer there, because 2.0.025 doesnt work with Dialog.prompt for some reason on my system

art2's top left corner is always at (0,0) in my script, so it would be the same anyway(?)

and there doesnt seem to be a moveTo function for groups in the reference manual, or am i wrong again

Scripts
08.08.14, 15:24
15.05.14, 14:23
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
Posts
10.01.17, 16:37
19.02.16, 06:03
19.02.16, 06:00
17.01.16, 11:00
12.01.16, 13:10
25.11.15, 08:19
Script of the Moment
Hexagonal Grid Generator 16.11.11