diff options
| author | Simon Tatham <anakin@pobox.com> | 2004-04-27 22:49:21 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2004-04-27 22:49:21 +0000 |
| commit | 03e486268314c77a0180c7c2c4fbe2bb74c1a553 (patch) | |
| tree | 22fb5a3935f5953faf732b2b977e8e730234017c /windows.c | |
| parent | c866e24f9a39e015071cd27311b557fb0ef43b41 (diff) | |
| download | puzzles-03e486268314c77a0180c7c2c4fbe2bb74c1a553.zip puzzles-03e486268314c77a0180c7c2c4fbe2bb74c1a553.tar.gz puzzles-03e486268314c77a0180c7c2c4fbe2bb74c1a553.tar.bz2 puzzles-03e486268314c77a0180c7c2c4fbe2bb74c1a553.tar.xz | |
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]
Diffstat (limited to 'windows.c')
| -rw-r--r-- | windows.c | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -47,11 +47,21 @@ void frontend_default_colour(frontend *fe, float *output) void draw_rect(frontend *fe, int x, int y, int w, int h, int colour) { - HBRUSH oldbrush = SelectObject(fe->hdc_bm, fe->brushes[colour]); - HPEN oldpen = SelectObject(fe->hdc_bm, fe->pens[colour]); - Rectangle(fe->hdc_bm, x, y, x+w, y+h); - SelectObject(fe->hdc_bm, oldbrush); - SelectObject(fe->hdc_bm, oldpen); + 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]); + HPEN oldpen = SelectObject(fe->hdc_bm, fe->pens[colour]); + Rectangle(fe->hdc_bm, x, y, x+w, y+h); + SelectObject(fe->hdc_bm, oldbrush); + SelectObject(fe->hdc_bm, oldpen); + } } void draw_line(frontend *fe, int x1, int y1, int x2, int y2, int colour) |