< prev index next >

src/java.desktop/unix/classes/sun/awt/X11GraphicsConfig.java

Print this page

        

@@ -47,10 +47,11 @@
 import sun.java2d.DisposerRecord;
 import sun.java2d.SurfaceData;
 import sun.java2d.loops.RenderLoops;
 import sun.java2d.loops.SurfaceType;
 import sun.java2d.loops.CompositeType;
+import sun.java2d.pipe.Region;
 import sun.java2d.x11.X11SurfaceData;
 import sun.awt.image.OffScreenImage;
 import sun.awt.image.SunVolatileImage;
 import sun.awt.image.SurfaceManager;
 

@@ -263,15 +264,15 @@
     public int getScale() {
         return getDevice().getScaleFactor();
     }
 
     public int scaleUp(int x) {
-        return x * getScale();
+        return Region.clipRound(x * (double)getScale());
     }
 
     public int scaleDown(int x) {
-        return x / getScale();
+        return Region.clipRound(x / (double)getScale());
     }
 
     /**
      *
      * Returns a Transform that can be composed with the default Transform
< prev index next >