Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gimp/ChangeLog,v
retrieving revision 1.10144.2.203
diff -u -2 -r1.10144.2.203 ChangeLog
--- ChangeLog	21 Jun 2005 22:11:35 -0000	1.10144.2.203
+++ ChangeLog	22 Jun 2005 22:41:18 -0000
@@ -1,2 +1,13 @@
+2005-06-23  Tor Lillqvist  <tml@novell.com>
+
+	* app/tools/gimpdrawtool.c (gimp_draw_tool_draw_boundary): Sort
+	the boundary so that GIMP_CANVAS_STYLE_XOR drawing (which uses
+	GDK_CAP_NOT_LAST) works better. Remove the dubious code snippet
+	that offset some segments by one pixel. It didn't do what the
+	comment said, and why one would need to to what the comment said,
+	or what it actually did, is unclear. Now brush outlines don't have
+	so many gaps any longer. (There are still some gaps for
+	pathological brushes.)
+
 2005-06-21  Bill Skaggs  <weskaggs@primate.ucdavis.edu>
 
Index: app/tools/gimpdrawtool.c
===================================================================
RCS file: /cvs/gnome/gimp/app/tools/gimpdrawtool.c,v
retrieving revision 1.56
diff -u -2 -r1.56 gimpdrawtool.c
--- app/tools/gimpdrawtool.c	14 Nov 2004 02:50:14 -0000	1.56
+++ app/tools/gimpdrawtool.c	22 Jun 2005 22:41:19 -0000
@@ -1288,4 +1288,5 @@
   gint              x, y;
   gint              i;
+  gint              num_groups;
 
   g_return_if_fail (GIMP_IS_DRAW_TOOL (draw_tool));
@@ -1294,4 +1295,6 @@
   shell = GIMP_DISPLAY_SHELL (draw_tool->gdisp->shell);
 
+  bound_segs = sort_boundary (bound_segs, n_bound_segs, &num_groups);
+
   gdk_segs   = g_new0 (GdkSegment, n_bound_segs);
   n_gdk_segs = 0;
@@ -1322,25 +1325,5 @@
       if (gdk_segs[n_gdk_segs].x1 == gdk_segs[n_gdk_segs].x2 &&
           gdk_segs[n_gdk_segs].y1 == gdk_segs[n_gdk_segs].y2)
-        continue;
-
-      /*  If this segment is a closing segment && the segments lie inside
-       *  the region, OR if this is an opening segment and the segments
-       *  lie outside the region...
-       *  we need to transform it by one display pixel
-       */
-      if (! bound_segs[i].open)
-        {
-          /*  If it is vertical  */
-          if (gdk_segs[n_gdk_segs].x1 == gdk_segs[n_gdk_segs].x2)
-            {
-              gdk_segs[n_gdk_segs].x1 -= 1;
-              gdk_segs[n_gdk_segs].x2 -= 1;
-            }
-          else
-            {
-              gdk_segs[n_gdk_segs].y1 -= 1;
-              gdk_segs[n_gdk_segs].y2 -= 1;
-            }
-        }
+	  continue;
 
       n_gdk_segs++;
@@ -1352,3 +1335,4 @@
 
   g_free (gdk_segs);
+  g_free (bound_segs);
 }
