[seam-issues] [JBoss JIRA] Created: (JBSEAM-4833) Erroneous integer divisions in Image.scaleToFit()
Nicholas Oxhøj (JIRA)
jira-events at lists.jboss.org
Fri Aug 5 07:54:01 EDT 2011
Erroneous integer divisions in Image.scaleToFit()
-------------------------------------------------
Key: JBSEAM-4833
URL: https://issues.jboss.org/browse/JBSEAM-4833
Project: Seam 2
Issue Type: Bug
Components: JSF Controls
Affects Versions: 2.2.0.GA
Reporter: Nicholas Oxhøj
Priority: Minor
org.jboss.seam.ui.graphicImage.Image.scaleToFit(int height, int width) will most of the time just scale to the specified width, because it contains an error. The
ratios are calculated using integer division and will most likely both be 0.
Instead of
float hratio = height/getHeight();
float wratio = width/getWidth();
it should be
float hratio = (float) height/image.getHeight();
float wratio = (float) width/image.getWidth();
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues
mailing list