Hi, my former patch for drawLine had an unwanted impact on all non-1-pixel lines. This version intercepts 1-pixel line drawing actions and finishes the job by painting a 1 pixel rectangle.
ChangeLog:
2006-07-25 Robert Schuster <[EMAIL PROTECTED]>
* java/awt/peer/gtk/CairoGraphics.java:
(drawLine): Added special case for 1 pixel lines.
cya
Robert
Index: gnu/java/awt/peer/gtk/CairoGraphics2D.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java,v
retrieving revision 1.32
diff -u -r1.32 CairoGraphics2D.java
--- gnu/java/awt/peer/gtk/CairoGraphics2D.java 25 Jul 2006 20:26:30 -0000 1.32
+++ gnu/java/awt/peer/gtk/CairoGraphics2D.java 25 Jul 2006 20:57:27 -0000
@@ -1038,7 +1038,13 @@
public void drawLine(int x1, int y1, int x2, int y2)
{
- cairoDrawLine(nativePointer, x1, y1, x2 + 0.5, y2 + 0.5);
+ // The coordinates being pairwise identical means one wants
+ // to draw a single pixel. This is emulated by drawing
+ // a one pixel sized rectangle.
+ if (x1 == x2 && y1 == y2)
+ cairoFillRect(nativePointer, x1, y1, 1, 1);
+ else
+ cairoDrawLine(nativePointer, x1, y1, x2, y2);
}
public void drawRect(int x, int y, int width, int height)
signature.asc
Description: OpenPGP digital signature
