mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
A-_ha_! The Windows Rectangle() call appears to get uppity if asked
to draw a 1x1 rectangle, presumably on the grounds that that's beneath its dignity and you ought to be using SetPixel() instead. So now I do, and now Net actually looks exactly the same on Windows and GTK. Woo! [originally from svn r4157]
This commit is contained in:
10
windows.c
10
windows.c
@ -47,12 +47,22 @@ void frontend_default_colour(frontend *fe, float *output)
|
|||||||
|
|
||||||
void draw_rect(frontend *fe, int x, int y, int w, int h, int colour)
|
void draw_rect(frontend *fe, int x, int y, int w, int h, int colour)
|
||||||
{
|
{
|
||||||
|
if (w == 1 && h == 1) {
|
||||||
|
/*
|
||||||
|
* Rectangle() appears to get uppity if asked to draw a 1x1
|
||||||
|
* rectangle, presumably on the grounds that that's beneath
|
||||||
|
* its dignity and you ought to be using SetPixel instead.
|
||||||
|
* So I will.
|
||||||
|
*/
|
||||||
|
SetPixel(fe->hdc_bm, x, y, fe->colours[colour]);
|
||||||
|
} else {
|
||||||
HBRUSH oldbrush = SelectObject(fe->hdc_bm, fe->brushes[colour]);
|
HBRUSH oldbrush = SelectObject(fe->hdc_bm, fe->brushes[colour]);
|
||||||
HPEN oldpen = SelectObject(fe->hdc_bm, fe->pens[colour]);
|
HPEN oldpen = SelectObject(fe->hdc_bm, fe->pens[colour]);
|
||||||
Rectangle(fe->hdc_bm, x, y, x+w, y+h);
|
Rectangle(fe->hdc_bm, x, y, x+w, y+h);
|
||||||
SelectObject(fe->hdc_bm, oldbrush);
|
SelectObject(fe->hdc_bm, oldbrush);
|
||||||
SelectObject(fe->hdc_bm, oldpen);
|
SelectObject(fe->hdc_bm, oldpen);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void draw_line(frontend *fe, int x1, int y1, int x2, int y2, int colour)
|
void draw_line(frontend *fe, int x1, int y1, int x2, int y2, int colour)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user