[seam-issues] [JBoss JIRA] Updated: (JBSEAM-4833) Erroneous integer divisions in Image.scaleToFit()

Marek Novotny (JIRA) jira-events at lists.jboss.org
Mon Aug 8 07:34:24 EDT 2011


     [ https://issues.jboss.org/browse/JBSEAM-4833?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marek Novotny updated JBSEAM-4833:
----------------------------------

         Assignee: Marek Novotny
    Fix Version/s: 2.3.0.ALPHA


> 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
>            Assignee: Marek Novotny
>            Priority: Minor
>             Fix For: 2.3.0.ALPHA
>
>
> 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