aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-08-28 13:52:58 +0000
committerSimon Tatham <anakin@pobox.com>2005-08-28 13:52:58 +0000
commit8f46a30e69ca959dc73e7ad221ced4c98cf54528 (patch)
treeddb88f8ef316aa43923f759651ad4d6147ea3834
parent1d0573109cf927028e1130cc2f3f6edc3a699f91 (diff)
downloadpuzzles-8f46a30e69ca959dc73e7ad221ced4c98cf54528.zip
puzzles-8f46a30e69ca959dc73e7ad221ced4c98cf54528.tar.gz
puzzles-8f46a30e69ca959dc73e7ad221ced4c98cf54528.tar.bz2
puzzles-8f46a30e69ca959dc73e7ad221ced4c98cf54528.tar.xz
There seems to be some odd behaviour when GTK is asked to draw an
outline polygon with a clipping rectangle active. I don't know or care whether this is GTK or my X server or what, but I'm working around it by drawing the lines myself, which seems to sort it out. [originally from svn r6227]
-rw-r--r--gtk.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gtk.c b/gtk.c
index b72752a..1cf5136 100644
--- a/gtk.c
+++ b/gtk.c
@@ -373,7 +373,17 @@ void gtk_draw_poly(void *handle, int *coords, int npoints,
}
assert(outlinecolour >= 0);
gdk_gc_set_foreground(fe->gc, &fe->colours[outlinecolour]);
- gdk_draw_polygon(fe->pixmap, fe->gc, FALSE, points, npoints);
+
+ /*
+ * In principle we ought to be able to use gdk_draw_polygon for
+ * the outline as well. In fact, it turns out to interact badly
+ * with a clipping region, for no terribly obvious reason, so I
+ * draw the outline as a sequence of lines instead.
+ */
+ for (i = 0; i < npoints; i++)
+ gdk_draw_line(fe->pixmap, fe->gc,
+ points[i].x, points[i].y,
+ points[(i+1)%npoints].x, points[(i+1)%npoints].y);
sfree(points);
}