Index: trunk/src/org/openstreetmap/josm/tools/ImageResource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ImageResource.java	(revision 9280)
+++ trunk/src/org/openstreetmap/josm/tools/ImageResource.java	(revision 9281)
@@ -160,16 +160,9 @@
         float realWidth;
         float realHeight;
+        int maxWidth = maxSize.width;
+        int maxHeight = maxSize.height;
         if (svg != null) {
             realWidth = svg.getWidth();
             realHeight = svg.getHeight();
-            /* extend small images to the possible maximum, may get reduced later again */
-            if (maxSize.width != -1 && realWidth < maxSize.width) {
-                realHeight *= maxSize.width/realWidth;
-                realWidth = maxSize.width;
-            }
-            if (maxSize.height != -1 && realHeight < maxSize.height) {
-                realWidth *= maxSize.height/realHeight;
-                realHeight = maxSize.height;
-            }
         } else {
             if (baseImage == null) throw new AssertionError();
@@ -177,15 +170,12 @@
             realWidth = icon.getIconWidth();
             realHeight = icon.getIconHeight();
+            if (realWidth <= maxWidth) {
+                maxWidth = -1;
+            }
+            if (realHeight <= maxHeight) {
+                maxHeight = -1;
+            }
         }
-        int maxWidth = maxSize.width;
-        int maxHeight = maxSize.height;
-
-        if (realWidth <= maxWidth) {
-            maxWidth = -1;
-        }
-        if (realHeight <= maxHeight) {
-            maxHeight = -1;
-        }
-
+        
         if (maxWidth == -1 && maxHeight == -1)
             return getImageIcon(DEFAULT_DIMENSION);
