X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/9354872162d7a3fbfba456a8f94b594483e7630c..444203b4c3de7b9a8c51fc940927c6f8352cd898:/gtk.c?ds=sidebyside diff --git a/gtk.c b/gtk.c index b72752a..802c42e 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); } @@ -540,6 +550,10 @@ static gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) keyval = MOD_NUM_KEYPAD | '0'; else if (event->keyval == GDK_KP_Begin || event->keyval == GDK_KP_5) keyval = MOD_NUM_KEYPAD | '5'; + else if (event->keyval == GDK_BackSpace || + event->keyval == GDK_Delete || + event->keyval == GDK_KP_Delete) + keyval = '\177'; else if (event->string[0] && !event->string[1]) keyval = (unsigned char)event->string[0]; else