Changeset - r27292:40691ca8edc7
[Not reviewed]
master
0 1 0
Peter Nelson - 19 months ago 2023-05-09 11:50:37
peter1138@openttd.org
Change: Use iterator when drawing industry cargo window.
1 file changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/industry_gui.cpp
Show inline comments
 
@@ -2935,8 +2935,8 @@ struct IndustryCargoesWindow : public Wi
 

	
 
		const NWidgetBase *nwp = this->GetWidget<NWidgetBase>(WID_IC_PANEL);
 
		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;
 
		int row_height = CargoesField::small_height;
 
		for (const auto &field : this->fields) {
 
			if (vpos + row_height >= 0) {
 
				int xpos = left_pos;
 
				int col, dir;
 
@@ -2948,13 +2948,14 @@ struct IndustryCargoesWindow : public Wi
 
					dir = 1;
 
				}
 
				while (col >= 0 && col <= last_column) {
 
					this->fields[i].columns[col].Draw(xpos, vpos);
 
					field.columns[col].Draw(xpos, vpos);
 
					xpos += (col & 1) ? CargoesField::cargo_field_width : CargoesField::industry_width;
 
					col += dir;
 
				}
 
			}
 
			vpos += row_height;
 
			if (vpos >= height) break;
 
			row_height = CargoesField::normal_height;
 
		}
 
	}
 

	
0 comments (0 inline, 0 general)