summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-02-21 17:52:43 +0000
committeryexo <yexo@openttd.org>2010-02-21 17:52:43 +0000
commite6e2e8b47306c185007f9900d85279ab0f348de7 (patch)
treeb7134298d6f465be8422b325827c1e46e568e78c
parent04087c1bf005cb6ac88d6a82946ba589c95a490e (diff)
downloadopenttd-e6e2e8b47306c185007f9900d85279ab0f348de7.tar.xz
(svn r19187) -Fix [FS#3634]: the vehicle info in the autoreplace gui was drawn even when the window was shaded
-rw-r--r--src/autoreplace_gui.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp
index 091ac854b..35dccda5e 100644
--- a/src/autoreplace_gui.cpp
+++ b/src/autoreplace_gui.cpp
@@ -382,20 +382,22 @@ public:
this->DrawWidgets();
- int needed_height = this->details_height;
- /* Draw details panels. */
- for (int side = 0; side < 2; side++) {
- if (this->sel_engine[side] != INVALID_ENGINE) {
- NWidgetBase *nwi = this->GetWidget<NWidgetBase>(side == 0 ? RVW_WIDGET_LEFT_DETAILS : RVW_WIDGET_RIGHT_DETAILS);
- 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[side]);
- 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[side] != INVALID_ENGINE) {
+ NWidgetBase *nwi = this->GetWidget<NWidgetBase>(side == 0 ? RVW_WIDGET_LEFT_DETAILS : RVW_WIDGET_RIGHT_DETAILS);
+ 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[side]);
+ 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;
}
}