diff options
| author | Simon Tatham <anakin@pobox.com> | 2010-05-29 15:43:46 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2010-05-29 15:43:46 +0000 |
| commit | 9cd182ffa92e97609d562883a1c8e74949963ba0 (patch) | |
| tree | 43f35c00ac8d248209c3c40ebb9ac9d1a3e5e302 /loopy.c | |
| parent | ef6e78c6ac804a197cfc6002c5866885321626c5 (diff) | |
| download | puzzles-9cd182ffa92e97609d562883a1c8e74949963ba0.zip puzzles-9cd182ffa92e97609d562883a1c8e74949963ba0.tar.gz puzzles-9cd182ffa92e97609d562883a1c8e74949963ba0.tar.bz2 puzzles-9cd182ffa92e97609d562883a1c8e74949963ba0.tar.xz | |
Patch from Mark Wooding to introduce a draw_thick_line() function in
the drawing API, for use by Loopy. It's optional: drawing.c will
construct an acceptable alternative using a filled polygon if the
front end doesn't provide it.
Net and Netslide previously had static functions called
draw_thick_line(), whose claim to the name is less justified and so
they've been renamed.
[originally from svn r8962]
Diffstat (limited to 'loopy.c')
| -rw-r--r-- | loopy.c | 19 |
1 files changed, 4 insertions, 15 deletions
@@ -3543,21 +3543,10 @@ static void game_redraw(drawing *dr, game_drawstate *ds, game_state *oldstate, if (draw_faint_lines) draw_line(dr, x1, y1, x2, y2, line_colour); } else { - /* (dx, dy) points roughly from (x1, y1) to (x2, y2). - * The line is then "fattened" in a (roughly) perpendicular - * direction to create a thin rectangle. */ - int dx = (x1 > x2) ? -1 : ((x1 < x2) ? 1 : 0); - int dy = (y1 > y2) ? -1 : ((y1 < y2) ? 1 : 0); - int points[8]; - points[0] = x1 + dy; - points[1] = y1 - dx; - points[2] = x1 - dy; - points[3] = y1 + dx; - points[4] = x2 - dy; - points[5] = y2 + dx; - points[6] = x2 + dy; - points[7] = y2 - dx; - draw_polygon(dr, points, 4, line_colour, line_colour); + draw_thick_line(dr, 3.0, + x1 + 0.5, y1 + 0.5, + x2 + 0.5, y2 + 0.5, + line_colour); } if (ds->started) { /* Draw dots at ends of the line */ |