Off-by-one in gdk_draw_poly



There's an off-by-one bug in gdk_draw_polygon ... Code-example:

GdkPoint points2[3] = {{x+2,y+2},{x+9,y+2},{x+2,x+9}};
GdkPoint points3[3] = {{x+15+2,y+2},{x+15+9,y+2},{x+15+2,x+9}};
/* Same, only 15 pix to the right to separate */

/* draw the polys with first filled, then nonfilled on the same place */
gdk_draw_polygon(window, light_gc,                         TRUE, points2, 3);
gdk_draw_polygon(window, style->bg_gc[GTK_STATE_SELECTED],FALSE, points2, 3);
/* then do the same, but nonfilled then filled */
gdk_draw_polygon(window, light_gc,                        FALSE, points3, 3);
gdk_draw_polygon(window, style->bg_gc[GTK_STATE_SELECTED], TRUE, points3, 3);
/* code snip from my upcoming gtk-theme */

which results in the image:
http://www.ing.umu.se/~stric/gdkpoly.gif

The one to the right shouldn't have any white stuff, since the blue
should cover it.. but it doesn't...

Should I accept it and work around it, or will it be fixed? (too scared
to poke around in gdk/X myself ;P )

BTW, did my bug-report on pixmap-themes really end up here? I haven't
seen it in the archives.. now I'm subscribed here and hope that this
report comes through...

Short on the pixmap-theme bug: http://www.ing.umu.se/~stric/gtkgimp.gif
gdkrgb and some other special-widgets never shows up, instead you get
whatever is behind them... (I've started a new image, so the gdkrgb
should display a pure white color, instead I get my background pic)

I'm using linux/x86 gimp -> 8bit sun display.

/Tomas
-- 
Tomas Ögren, stric@ing.umu.se, http://www.ing.umu.se/~stric/
|- Student of Computer Science at the University of Umeå
`- Sysadmin at {ing,acc}.umu.se



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]