Some fill operations, namely fillRect, were affected by a pixel offset
that should only be applied to draw operations.  This fixes it, along
with the textures bug.

Cheers,
Francis


2006-10-10  Francis Kung  <[EMAIL PROTECTED]>

        PR 29372
        * gnu/java/awt/peer/gtk/CairoGraphics2D.java
        (createPath): Added isDraw parameter.
        (draw): Updated createPath call.
        (fill): Updated createPath call.

Index: gnu/java/awt/peer/gtk/CairoGraphics2D.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java,v
retrieving revision 1.42
diff -u -r1.42 CairoGraphics2D.java
--- gnu/java/awt/peer/gtk/CairoGraphics2D.java	3 Oct 2006 19:47:58 -0000	1.42
+++ gnu/java/awt/peer/gtk/CairoGraphics2D.java	10 Oct 2006 20:21:24 -0000
@@ -1017,13 +1017,13 @@
         return;
       }
 
-    createPath(s);
+    createPath(s, true);
     cairoStroke(nativePointer);
   }
 
   public void fill(Shape s)
   {
-    createPath(s);
+    createPath(s, false);
 
     double alpha = 1.0;
     if (comp instanceof AlphaComposite)
@@ -1031,7 +1031,7 @@
     cairoFill(nativePointer, alpha);
   }
 
-  private void createPath(Shape s)
+  private void createPath(Shape s, boolean isDraw)
   {
     cairoNewPath(nativePointer);
 
@@ -1039,8 +1039,8 @@
     if (s instanceof Rectangle2D)
       {
         Rectangle2D r = (Rectangle2D) s;
-        cairoRectangle(nativePointer, shifted(r.getX(), shiftDrawCalls),
-                       shifted(r.getY(), shiftDrawCalls), r.getWidth(),
+        cairoRectangle(nativePointer, shifted(r.getX(),shiftDrawCalls && isDraw),
+                       shifted(r.getY(), shiftDrawCalls && isDraw), r.getWidth(),
                        r.getHeight());
       }
 
@@ -1070,9 +1070,9 @@
           }
 
         cairoArc(nativePointer,
-                 shifted(e.getCenterX() / xscale, shiftDrawCalls),
-                 shifted(e.getCenterY() / yscale, shiftDrawCalls), radius, 0,
-                 Math.PI * 2);
+                 shifted(e.getCenterX() / xscale, shiftDrawCalls && isDraw),
+                 shifted(e.getCenterY() / yscale, shiftDrawCalls && isDraw),
+                 radius, 0, Math.PI * 2);
 
         if (xscale != 1 || yscale != 1)
           cairoRestore(nativePointer);
@@ -1081,7 +1081,7 @@
     // All other shapes are broken down and drawn in steps using the
     // PathIterator
     else
-      walkPath(s.getPathIterator(null), shiftDrawCalls);
+      walkPath(s.getPathIterator(null), shiftDrawCalls && isDraw);
   }
 
   /**

Reply via email to