🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
3 messages
3 total messages Started by Current_Point Thu, 12 Feb 2009 20:39
Rotate around a coordinate
#1388
Author: Current_Point
Date: Thu, 12 Feb 2009 20:39
9 lines
1123 bytes
Has anyone had any luck rotating an obj around an origin other than the constant values (ie center anchor)? I'm trying to rotate an obj around an x/y coordinate (instead of an objects anchor point)...

transform myFrame in pasteboard coordinates from {4.25, 5.5} with matrix myMatrix

It doesn't error, but it just doesn't return predictable results. Almost like a math error or something. The non-matrix rotation method used in InDesign versions CS/CS2 worked perfectly...

rotate myFrame by 45 around {4.25, 8.5}

Any thoughts are greatly appreciated.
Re: Rotate around a coordinate
#1389
Author: Olav_Kvern
Date: Thu, 12 Feb 2009 21:10
15 lines
1324 bytes
Hi Current Point,

The trouble here is that {4.25, 5.5} in pasteboard coordinates is going to be a location near the top of the *visible* pasteboard for the first spread of the document. The pasteboard you see around each spread is not the "pasteboard" referred to in "pasteboard coordinates." The "pasteboard coordinates" referred to in this case is the global coordinate system behind all of the spreads in the document.

But the transform method has an added parameter, "considering ruler units", that will do what you want. Something more like this should do the trick:



transform myFrame in pasteboard coordinates from {4.25, 5.5} with matrix myMatrix considering ruler units true



Thanks,

Ole
Re: Rotate around a coordinate
#1248
Author: Current_Point
Date: Fri, 13 Feb 2009 02:26
16 lines
1526 bytes
Thanks for the reply Olav, and the heads up on using "considering ruler units".

I think I've figured this out. Two details...

If the "from" value is a list of 2 integers (as in an x/y coordinate), the numbers seem to always be processed as points (even with the "considering ruler units" option, and the ruler units being decimal inches).

Even more odd, the 0/0 origin is the exact center of the page. So if you transform as...

transform myFrame in pasteboard coordinates from {0, 0} with matrix myMatrix

...the object will rotate around the center of the page. So an object in the top half of the page requires a negative Y value (as in {0, -72}) and so on.

Very strange, but I am getting predictable results now. I would usually use the fixed values (center anchor, etc) which work as expected, but using a coordinate value can be useful for drawing objects around a center point (like numbers on a clock).

Thanks again
Rik
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads