rotate

A discussion forum for FXGraphics2D (adds a Java2D API to the JavaFX Canvas).

rotate

Postby 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
bbolstad
 
Posts: 2
Joined: Wed Mar 02, 2016 9:01 pm

Re: rotate

Postby 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: 11647
Joined: Fri Mar 14, 2003 10:29 am

Re: rotate

Postby 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
david.gilbert
JFreeChart Project Leader
 
Posts: 11647
Joined: Fri Mar 14, 2003 10:29 am

Re: rotate

Postby bbolstad » Fri Mar 04, 2016 1:38 pm

Awesome--thanks so much for the quick response!
bbolstad
 
Posts: 2
Joined: Wed Mar 02, 2016 9:01 pm


Return to FXGraphics2D

Who is online

Users browsing this forum: No registered users and 1 guest