1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-16 17:02:37 +01:00

(svn r25133) [1.3] -Backport from trunk:

- Fix: Station rebuilding could leave reserved tiles which caused crashes later on [FS#5510, FS#5516] (r25132)
- Fix: When the count for a scrollbar was 0, the inter distance was subtracted too much causing a scrollbar with a negative size (r25123)
This commit is contained in:
rubidium
2013-03-31 20:32:21 +00:00
parent 0e692735c4
commit 585f0ef91c
2 changed files with 12 additions and 3 deletions

View File

@@ -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);