Changeset - r28803:93db387017f6
[Not reviewed]
master
0 1 0
Peter Nelson - 10 months ago 2024-02-22 22:23:29
peter1138@openttd.org
Fix b7630b0: Incorrect padding for text purchase list. (#12160)

Restore to original (and more normal) framerect padding.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -1812,25 +1812,25 @@ struct BuildVehicleWindow : Window {
 

	
 
		this->SetWidgetsDisabledState(this->sel_engine == INVALID_ENGINE, WID_BV_SHOW_HIDE, WID_BV_BUILD);
 

	
 
		/* Disable renaming engines in network games if you are not the server. */
 
		this->SetWidgetDisabledState(WID_BV_RENAME, this->sel_engine == INVALID_ENGINE || (_networking && !_network_server));
 

	
 
		this->DrawWidgets();
 

	
 
		if (!this->IsShaded()) {
 
			int needed_height = this->details_height;
 
			/* Draw details panels. */
 
			if (this->sel_engine != INVALID_ENGINE) {
 
				const Rect r = this->GetWidget<NWidgetBase>(WID_BV_PANEL)->GetCurrentRect().Shrink(WidgetDimensions::scaled.frametext, WidgetDimensions::scaled.framerect);
 
				const Rect r = this->GetWidget<NWidgetBase>(WID_BV_PANEL)->GetCurrentRect().Shrink(WidgetDimensions::scaled.framerect);
 
				int text_end = DrawVehiclePurchaseInfo(r.left, r.right, r.top, this->sel_engine, this->te);
 
				needed_height = std::max(needed_height, (text_end - r.top) / GetCharacterHeight(FS_NORMAL));
 
			}
 
			if (needed_height != this->details_height) { // Details window are not high enough, enlarge them.
 
				int resize = needed_height - this->details_height;
 
				this->details_height = needed_height;
 
				this->ReInit(0, resize * GetCharacterHeight(FS_NORMAL));
 
				return;
 
			}
 
		}
 
	}
 

	
0 comments (0 inline, 0 general)