Fix a dialog size problem returning invalid sizes.

Fixes bug #13203.
This commit is contained in:
Mark de Wever 2009-03-17 20:41:59 +00:00
parent 13460cf141
commit 3d6ce66f1d
2 changed files with 12 additions and 1 deletions

View file

@ -6,6 +6,7 @@ Version 1.5.14+svn:
* updated translations: Portuguese (Brazil), Russian
* User interface:
* Grey game titles out when we're missing the era
* Fix a dialog size problem returning invalid sizes (bug #13203)
* WML Engine:
* Increase the map size limit to 1000 by 1000
* Added an 'always_display' key to [advancement] to make it possible to show

View file

@ -172,12 +172,22 @@ bool tscrollbar_container::has_horizontal_scrollbar() const
void tscrollbar_container::
layout_use_vertical_scrollbar(const unsigned maximum_height)
{
assert(vertical_scrollbar_grid_);
// Inherited.
twidget::layout_use_vertical_scrollbar(maximum_height);
tpoint size = get_best_size();
if(static_cast<unsigned>(size.y) < maximum_height) {
return;
}
size.y = maximum_height;
const tpoint scrollbar_size = vertical_scrollbar_grid_->get_best_size();
if(maximum_height > static_cast<unsigned>(scrollbar_size.y)) {
size.y = maximum_height;
} else {
size.y = scrollbar_size.y;
}
// FIXME adjust for the step size of the scrollbar