Changeset - r27291:bcb6a5c5774f
[Not reviewed]
master
0 1 0
Peter Nelson - 19 months ago 2023-05-09 11:50:06
peter1138@openttd.org
Fix: Incorrect padding on industry cargo window.
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/industry_gui.cpp
Show inline comments
 
@@ -1872,7 +1872,7 @@ static const NWidgetPart _nested_industr
 
		NWidget(WWT_STICKYBOX, COLOUR_BROWN),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PANEL, COLOUR_BROWN, WID_IC_PANEL), SetResize(1, 10), SetMinimalSize(200, 90), SetScrollbar(WID_IC_SCROLLBAR), EndContainer(),
 
		NWidget(WWT_PANEL, COLOUR_BROWN, WID_IC_PANEL), SetResize(1, 10), SetScrollbar(WID_IC_SCROLLBAR), EndContainer(),
 
		NWidget(NWID_VSCROLLBAR, COLOUR_BROWN, WID_IC_SCROLLBAR),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
@@ -2924,17 +2924,17 @@ struct IndustryCargoesWindow : public Wi
 
	{
 
		if (widget != WID_IC_PANEL) return;
 

	
 
		Rect ir = r.Shrink(WidgetDimensions::scaled.framerect);
 
		Rect ir = r.Shrink(WidgetDimensions::scaled.bevel);
 
		DrawPixelInfo tmp_dpi;
 
		if (!FillDrawPixelInfo(&tmp_dpi, ir.left, ir.top, ir.Width(), ir.Height())) return;
 
		AutoRestoreBackup dpi_backup(_cur_dpi, &tmp_dpi);
 

	
 
		int left_pos = ir.left;
 
		int left_pos = WidgetDimensions::scaled.frametext.left - WidgetDimensions::scaled.bevel.left;
 
		if (this->ind_cargo >= NUM_INDUSTRYTYPES) left_pos += (CargoesField::industry_width + CargoesField::cargo_field_width) / 2;
 
		int last_column = (this->ind_cargo < NUM_INDUSTRYTYPES) ? 4 : 2;
 

	
 
		const NWidgetBase *nwp = this->GetWidget<NWidgetBase>(WID_IC_PANEL);
 
		int vpos = -this->vscroll->GetPosition() * nwp->resize_y;
 
		int vpos = WidgetDimensions::scaled.frametext.top - WidgetDimensions::scaled.bevel.top - this->vscroll->GetPosition() * nwp->resize_y;
 
		for (uint i = 0; i < this->fields.size(); i++) {
 
			int row_height = (i == 0) ? CargoesField::small_height : CargoesField::normal_height;
 
			if (vpos + row_height >= 0) {
0 comments (0 inline, 0 general)