Don't allow > 1f scaling if constructed with maxWidth/maxHeight.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1677 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -39,8 +39,9 @@ public class ScaledIcon implements Icon
|
|||||||
*/
|
*/
|
||||||
public ScaledIcon (Icon icon, int maxWidth, int maxHeight)
|
public ScaledIcon (Icon icon, int maxWidth, int maxHeight)
|
||||||
{
|
{
|
||||||
this(icon, Math.min(maxWidth / (float) icon.getIconWidth(),
|
this(icon,
|
||||||
maxHeight / (float) icon.getIconHeight()));
|
Math.min(1f, Math.min(maxWidth / (float) icon.getIconWidth(),
|
||||||
|
maxHeight / (float) icon.getIconHeight()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited from interface Icon
|
// documentation inherited from interface Icon
|
||||||
|
|||||||
Reference in New Issue
Block a user