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
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
18.02.13, 13:41
10.01.13, 03:11
Posts
16.04.14, 06:00
11.04.14, 04:55
01.04.14, 11:20
27.03.14, 18:39
23.03.14, 17:33
21.03.14, 12:39
Script of the Moment
Lissajous 10.01.13