mirror of https://github.com/OpenTTD/OpenTTD
(svn r19187) -Fix [FS#3634]: the vehicle info in the autoreplace gui was drawn even when the window was shaded
parent
04087c1bf0
commit
e6e2e8b473
|
@ -382,20 +382,22 @@ public:
|
||||||
|
|
||||||
this->DrawWidgets();
|
this->DrawWidgets();
|
||||||
|
|
||||||
int needed_height = this->details_height;
|
if (!this->IsShaded()) {
|
||||||
/* Draw details panels. */
|
int needed_height = this->details_height;
|
||||||
for (int side = 0; side < 2; side++) {
|
/* Draw details panels. */
|
||||||
if (this->sel_engine[side] != INVALID_ENGINE) {
|
for (int side = 0; side < 2; side++) {
|
||||||
NWidgetBase *nwi = this->GetWidget<NWidgetBase>(side == 0 ? RVW_WIDGET_LEFT_DETAILS : RVW_WIDGET_RIGHT_DETAILS);
|
if (this->sel_engine[side] != INVALID_ENGINE) {
|
||||||
int text_end = DrawVehiclePurchaseInfo(nwi->pos_x + WD_FRAMETEXT_LEFT, nwi->pos_x + nwi->current_x - WD_FRAMETEXT_RIGHT,
|
NWidgetBase *nwi = this->GetWidget<NWidgetBase>(side == 0 ? RVW_WIDGET_LEFT_DETAILS : RVW_WIDGET_RIGHT_DETAILS);
|
||||||
nwi->pos_y + WD_FRAMERECT_TOP, this->sel_engine[side]);
|
int text_end = DrawVehiclePurchaseInfo(nwi->pos_x + WD_FRAMETEXT_LEFT, nwi->pos_x + nwi->current_x - WD_FRAMETEXT_RIGHT,
|
||||||
needed_height = max(needed_height, text_end - (int)nwi->pos_y + WD_FRAMERECT_BOTTOM);
|
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue