Hi,

This patch rounds the bounds in BufferedImageGraphics.drawGlyphVector rather than casting/truncating; this fixes a few clipping issues with some string drawing.

Cheers,
Francis


2006-12-18  Francis Kung  <[EMAIL PROTECTED]>

        * gnu/java/awt/peer/gtk/BufferedImageGraphics.java
        (drawGlyphVector): Round bounds instead of casting & truncating..
### Eclipse Workspace Patch 1.0
#P classpath
Index: gnu/java/awt/peer/gtk/BufferedImageGraphics.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/BufferedImageGraphics.java,v
retrieving revision 1.21
diff -u -r1.21 BufferedImageGraphics.java
--- gnu/java/awt/peer/gtk/BufferedImageGraphics.java	5 Dec 2006 20:43:50 -0000	1.21
+++ gnu/java/awt/peer/gtk/BufferedImageGraphics.java	18 Dec 2006 15:33:14 -0000
@@ -438,6 +438,11 @@
     if (comp == null || comp instanceof AlphaComposite)
       {
         super.drawGlyphVector(gv, x, y);
+        
+        // this returns an integer-based Rectangle (rather than a
+        // Rectangle2D), which takes care of any necessary rounding for us.
+        bounds = bounds.getBounds();
+        
         updateBufferedImage((int)bounds.getX(), (int)bounds.getY(),
                             (int)bounds.getWidth(), (int)bounds.getHeight());
       }

Reply via email to