Re: How to set rotation using an existing API

DeWeese Thomas <[email protected]>
Newsgroups gmane.text.xml.batik.user
Message-ID <[email protected]>
Hi fireball,

On Nov 1, 2012, at 11:19 AM, fireball <[email protected]> wrote:

> I am using AffineTransform to rotate SVG elements but as far as I understand
> it only provides two methods to rotate. One sets it identity matrix with a
> rotation (setToRotation(theta)) and another rotates by a delta
> (rotate(theta)).
> 
> What I want to do is set rotation to specific angle. I.e. I don't want to
> set its matrix to identity matrix nor do I want to rotate by delta.

	The first method sets it to a specific rotation, not an identity matrix so it seems that is what you
want.


> I want to be able to set rotation like we can by setting 'rotate' attribute. Is
> there a way to do it using AffineTransform or another API?

	setToRotation does exactly what the 'rotate' function' does in the SVG transform attribute.

	I'm a little afraid that you are trying to adjust a general affine transform (that may have non-uniform
scaling and skew) so that it has a specific rotation. I'm afraid that is what you want to do because you can't 
really do it without coming up with a perhaps non-sensical definition of rotation...

	Thomas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.