Changeset - r20150:80fe3cc7d453
[Not reviewed]
master
0 1 0
rubidium - 11 years ago 2013-03-25 20:59:59
rubidium@openttd.org
(svn r25123) -Fix: when the count for a scrollbar was 0, the inter distance was subtracted too much causing a scrollbar with a negative size
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/widget.cpp
Show inline comments
 
@@ -1470,7 +1470,8 @@ void NWidgetMatrix::SetCount(int count)
 
	 * and post spacing "offsets". */
 
	count = CeilDiv(count, this->sb->IsVertical() ? this->widgets_x : this->widgets_y);
 
	count *= (this->sb->IsVertical() ? this->head->smallest_y : this->head->smallest_x) + this->pip_inter;
 
	count += -this->pip_inter + this->pip_pre + this->pip_post; // We counted an inter too much in the multiplication above
 
	if (count > 0) count -= this->pip_inter; // We counted an inter too much in the multiplication above
 
	count += this->pip_pre + this->pip_post;
 
	this->sb->SetCount(count);
 
	this->sb->SetCapacity(this->sb->IsVertical() ? this->current_y : this->current_x);
 
	this->sb->SetStepSize(this->sb->IsVertical() ? this->widget_h  : this->widget_w);
0 comments (0 inline, 0 general)