2 Replies Latest reply on Feb 12, 2009 6:26 PM by (Current_Point)

Rotate around a coordinate

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.
• 1. Re: Rotate around a coordinate
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
• 2. Re: Rotate around a coordinate
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