Index: layersel/layersel.c =================================================================== --- layersel/layersel.c (revision 8496) +++ layersel/layersel.c (revision 8497) @@ -53,16 +53,16 @@ { GdkPixbuf *pixbuf; GtkWidget *image; - gint width, height; + gint width, height, max_height; guchar *pixels; guint32 color = 0x00ff00ff; /* Green */ guint r, g, b, a; - guint w, h; + guint w; guchar *p; pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, 16, 16); width = gdk_pixbuf_get_width(pixbuf); /* 16 here, obviously */ - height = gdk_pixbuf_get_height(pixbuf); + max_height = height = gdk_pixbuf_get_height(pixbuf); pixels = gdk_pixbuf_get_pixels(pixbuf); /* Fill the whole rectangle with color */ r = (color & 0xff000000) >> 24; @@ -74,7 +74,13 @@ w = width; p = pixels; while (w--) { - if ((w > height) || (filled)) { + if ((height == 0) || (height == max_height-1) || (w == 0) || (w == width-1)) { + p[0] = 0x0; + p[1] = 0x0; + p[2] = 0x0; + p[3] = 0xff; + } + else if ((width-w+5 < height) || (filled)) { p[0] = r; p[1] = g; p[2] = b;