[seam-commits] Seam SVN: r9953 - trunk/ui/src/main/java/org/jboss/seam/ui/graphicImage.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Mon Jan 19 18:15:47 EST 2009
Author: norman.richards at jboss.com
Date: 2009-01-19 18:15:47 -0500 (Mon, 19 Jan 2009)
New Revision: 9953
Modified:
trunk/ui/src/main/java/org/jboss/seam/ui/graphicImage/Image.java
Log:
JBSEAM-3143
Modified: trunk/ui/src/main/java/org/jboss/seam/ui/graphicImage/Image.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/graphicImage/Image.java 2009-01-19 13:18:24 UTC (rev 9952)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/graphicImage/Image.java 2009-01-19 23:15:47 UTC (rev 9953)
@@ -322,6 +322,19 @@
return this;
}
+ public Image scaleToFit(int height, int width)
+ throws IOException
+ {
+ float hratio = height/getHeight();
+ float wratio = width/getWidth();
+
+ if (hratio < wratio) {
+ return scaleToHeight(height);
+ } else {
+ return scaleToWidth(width);
+ }
+ }
+
/**
* Scale the image to the given height
*/
More information about the seam-commits
mailing list