summaryrefslogtreecommitdiff
path: root/src/main_gui.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-07-29 16:43:58 +0000
committerpeter1138 <peter1138@openttd.org>2007-07-29 16:43:58 +0000
commit279ed3a9c1fc9c83abc6c24ee2aa88c24628cf74 (patch)
treef85a2c93d75da915f863a551ae99e4f215ef43a3 /src/main_gui.cpp
parent26c62dc5c055f53ad2387fae3b8f7190db5eedc7 (diff)
downloadopenttd-279ed3a9c1fc9c83abc6c24ee2aa88c24628cf74.tar.xz
(svn r10724) -Fix (r10723): Toolbar spacing was off-by-one
Diffstat (limited to 'src/main_gui.cpp')
-rw-r--r--src/main_gui.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index 4af8e5d5c..fba6ecb1d 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -1710,16 +1710,16 @@ static void MainToolbarWndProc(Window *w, WindowEvent *e)
uint extra_spacing_at[] = { 4, 8, 13, 17, 19, 24, 0 };
for (uint i = 0, x = 0, j = 0; i < 27; i++) {
- w->widget[i].left = x;
- x += (spacing != 0) ? button_width : (w->width - x) / (27 - i);
- w->widget[i].right = x - 1;
-
if (extra_spacing_at[j] == i) {
j++;
uint add = spacing / (lengthof(extra_spacing_at) - j);
spacing -= add;
x += add;
}
+
+ w->widget[i].left = x;
+ x += (spacing != 0) ? button_width : (w->width - x) / (27 - i);
+ w->widget[i].right = x - 1;
}
} break;