diff options
author | alberth <alberth@openttd.org> | 2009-12-23 10:12:43 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2009-12-23 10:12:43 +0000 |
commit | 52c7d9897e8fac2516f35b94b0a8d2ef5b001d1f (patch) | |
tree | d584d363c9da78a3165ebebe160d18a1cb76b719 /src | |
parent | 91747d72dca21fb92490738d90adc4a27989df04 (diff) | |
download | openttd-52c7d9897e8fac2516f35b94b0a8d2ef5b001d1f.tar.xz |
(svn r18612) -Fix [FS#3407]: Buy vehicle window did not properly disable panel drawing while shaded.
Diffstat (limited to 'src')
-rw-r--r-- | src/build_vehicle_gui.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 50a1ffd49..82e8c5403 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1119,20 +1119,22 @@ struct BuildVehicleWindow : Window { this->DrawWidgets(); - int needed_height = this->details_height; - /* Draw details panels. */ - for (int side = 0; side < 2; side++) { - if (this->sel_engine != INVALID_ENGINE) { - NWidgetBase *nwi = this->GetWidget<NWidgetBase>(BUILD_VEHICLE_WIDGET_PANEL); - int text_end = DrawVehiclePurchaseInfo(nwi->pos_x + WD_FRAMETEXT_LEFT, nwi->pos_x + nwi->current_x - WD_FRAMETEXT_RIGHT, - nwi->pos_y + WD_FRAMERECT_TOP, this->sel_engine); - needed_height = max(needed_height, text_end - (int)nwi->pos_y + WD_FRAMERECT_BOTTOM); + if (!this->IsShaded()) { + int needed_height = this->details_height; + /* Draw details panels. */ + for (int side = 0; side < 2; side++) { + if (this->sel_engine != INVALID_ENGINE) { + NWidgetBase *nwi = this->GetWidget<NWidgetBase>(BUILD_VEHICLE_WIDGET_PANEL); + int text_end = DrawVehiclePurchaseInfo(nwi->pos_x + WD_FRAMETEXT_LEFT, nwi->pos_x + nwi->current_x - WD_FRAMETEXT_RIGHT, + nwi->pos_y + WD_FRAMERECT_TOP, this->sel_engine); + needed_height = max(needed_height, text_end - (int)nwi->pos_y + WD_FRAMERECT_BOTTOM); + } + } + if (needed_height != this->details_height) { // Details window are not high enough, enlarge them. + this->details_height = needed_height; + this->ReInit(); + return; } - } - if (!this->IsShaded() && needed_height != this->details_height) { // Details window are not high enough, enlarge them. - this->details_height = needed_height; - this->ReInit(); - return; } } |