Changeset - r18833:5ee5152e885f
[Not reviewed]
master
0 1 0
rubidium - 13 years ago 2011-12-31 11:14:03
rubidium@openttd.org
(svn r23692) -Fix: use smallest_x of your children only when you let the children update it
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/network/network_gui.cpp
Show inline comments
 
@@ -110,13 +110,12 @@ public:
 

	
 
	void SetupSmallestSize(Window *w, bool init_array)
 
	{
 
		/* Oh yeah, we ought to be findable! */
 
		w->nested_array[WID_NG_HEADER] = this;
 

	
 
		this->smallest_x = this->head->smallest_x + this->tail->smallest_x; // First and last are always shown, rest not
 
		this->smallest_y = 0; // Biggest child.
 
		this->fill_x = 1;
 
		this->fill_y = 0;
 
		this->resize_x = 1; // We only resize in this direction
 
		this->resize_y = 0; // We never resize in this direction
 

	
 
@@ -128,12 +127,14 @@ public:
 

	
 
		/* ... then in a second pass make sure the 'current' sizes are set. Won't change for most widgets. */
 
		for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
 
			child_wid->current_x = child_wid->smallest_x;
 
			child_wid->current_y = this->smallest_y;
 
		}
 

	
 
		this->smallest_x = this->head->smallest_x + this->tail->smallest_x; // First and last are always shown, rest not
 
	}
 

	
 
	void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl)
 
	{
 
		assert(given_width >= this->smallest_x && given_height >= this->smallest_y);
 

	
0 comments (0 inline, 0 general)