summaryrefslogtreecommitdiff
path: root/widget.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2005-12-28 08:39:43 +0000
committerpeter1138 <peter1138@openttd.org>2005-12-28 08:39:43 +0000
commit37c3cd2e5bbe92b5455036387c2dcfab07ca9252 (patch)
treec2081d9b88732e4b5a1e9b3c7d90f6fd5d34b28f /widget.c
parent7e5da7d8b2942d57213290beae1d2e6300620a8a (diff)
downloadopenttd-37c3cd2e5bbe92b5455036387c2dcfab07ca9252.tar.xz
(svn r3349) Fix off-by-one error in drawing matrix widget, from r3181.
Diffstat (limited to 'widget.c')
-rw-r--r--widget.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/widget.c b/widget.c
index 3f9285c4c..b6b64352b 100644
--- a/widget.c
+++ b/widget.c
@@ -232,13 +232,13 @@ void DrawWindowWidgets(const Window *w)
color = _color_list[wi->color & 0xF].window_color_bgb;
x = r.left;
- for (ctr = c; ctr > 0; ctr--) {
+ for (ctr = c; ctr > 1; ctr--) {
x += amt1;
GfxFillRect(x, r.top + 1, x, r.bottom - 1, color);
}
x = r.top;
- for (ctr = d; ctr > 0; ctr--) {
+ for (ctr = d; ctr > 1; ctr--) {
x += amt2;
GfxFillRect(r.left + 1, x, r.right - 1, x, color);
}
@@ -246,13 +246,13 @@ void DrawWindowWidgets(const Window *w)
color = _color_list[wi->color&0xF].window_color_1b;
x = r.left - 1;
- for (ctr = c; ctr > 0; ctr--) {
+ for (ctr = c; ctr > 1; ctr--) {
x += amt1;
GfxFillRect(x, r.top + 1, x, r.bottom - 1, color);
}
x = r.top - 1;
- for (ctr = d; ctr > 0; ctr--) {
+ for (ctr = d; ctr > 1; ctr--) {
x += amt2;
GfxFillRect(r.left+1, x, r.right-1, x, color);
}