Changeset - r7361:4526784d7450
[Not reviewed]
master
0 2 0
peter1138 - 17 years ago 2007-07-29 16:43:58
peter1138@openttd.org
(svn r10724) -Fix (r10723): Toolbar spacing was off-by-one
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/main_gui.cpp
Show inline comments
 
@@ -1710,16 +1710,16 @@ static void MainToolbarWndProc(Window *w
 
		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;
 

	
0 comments (0 inline, 0 general)