Wrong parameter order in drawImage()

A discussion forum for FXGraphics2D (adds a Java2D API to the JavaFX Canvas).
Locked
michal.r
Posts: 2
Joined: Wed Jan 27, 2016 7:16 pm
antibot: No, of course not.

Wrong parameter order in drawImage()

Post by michal.r » Wed Jan 27, 2016 7:27 pm

Hello, there is a serious bug in FXGraphics2D.drawImage() in version 1.2.1

FXGraphics2D.java, line 1642. There is:

Code: Select all

BufferedImage img2 = new BufferedImage(BufferedImage.TYPE_INT_ARGB, w, h);
Should be:

Code: Select all

BufferedImage img2 = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
See https://docs.oracle.com/javase/7/docs/a ... Image.html

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

Re: Wrong parameter order in drawImage()

Post by david.gilbert » Wed Jan 27, 2016 8:40 pm

Hi,

Thanks for spotting that! The same bug was fixed in JFreeSVG and OrsonPDF some time back, so I'm a little embarrassed that I didn't remember to copy the same fix over to FXGraphics2D. I'll commit that now, I do a 1.3 release before too long.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

michal.r
Posts: 2
Joined: Wed Jan 27, 2016 7:16 pm
antibot: No, of course not.

Re: Wrong parameter order in drawImage()

Post by michal.r » Thu Jan 28, 2016 3:41 pm

Thanks!

Locked