rotate

A discussion forum for FXGraphics2D (adds a Java2D API to the JavaFX Canvas).
Post Reply
bbolstad
Posts: 2
Joined: Wed Mar 02, 2016 9:01 pm
antibot: No, of course not.

rotate

Post by bbolstad » Wed Mar 02, 2016 9:14 pm

Hello, I'm new to FXGraphics2D, so pardon me if I'm being dense, but is it just me, or is the rotate(double theta) API broken?

For Graphics2D (AWT), theta is expected to be in radians. For GraphicsContext (JFX), the angle is expected to be expressed in degrees.

FXGraphics2D 1.3 contains the following code for this method:

Code: Select all

this.gc.rotate(theta * Math.PI / 180);
Shouldn't this actually be something like:

Code: Select all

this.gc.rotate(Math.toDegrees(theta));
What am I missing?

Thanks,
BB

david.gilbert
JFreeChart Project Leader
Posts: 11683
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: rotate

Post by david.gilbert » Thu Mar 03, 2016 10:46 pm

I think you are right, the conversion from radians to degrees looks wrong. I'll fix that.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited

david.gilbert
JFreeChart Project Leader
Posts: 11683
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: rotate

Post by david.gilbert » Fri Mar 04, 2016 5:45 am

Thanks for your report, I committed this change for the next release:

https://github.com/jfree/fxgraphics2d/c ... fa2f57cd16
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited

bbolstad
Posts: 2
Joined: Wed Mar 02, 2016 9:01 pm
antibot: No, of course not.

Re: rotate

Post by bbolstad » Fri Mar 04, 2016 1:38 pm

Awesome--thanks so much for the quick response!

Post Reply