Wrong parameter order in drawImage()

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

Wrong parameter order in drawImage()

Postby 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
michal.r
 
Posts: 2
Joined: Wed Jan 27, 2016 7:16 pm

Re: Wrong parameter order in drawImage()

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

Re: Wrong parameter order in drawImage()

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

Thanks!
michal.r
 
Posts: 2
Joined: Wed Jan 27, 2016 7:16 pm


Return to FXGraphics2D

Who is online

Users browsing this forum: No registered users and 1 guest