Changeset - r28668:0add49cc4dd5
[Not reviewed]
master
0 1 0
Peter Nelson - 3 months ago 2024-02-04 08:51:19
peter1138@openttd.org
Fix #11972: Incorrect minimum width allocated to graph. (#11974)

Width was based on actual number of data points instead of possible number of data points.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/graph_gui.cpp
Show inline comments
 
@@ -548,7 +548,7 @@ public:
 
		SetDParam(1, INT64_MAX);
 
		uint y_label_width = GetStringBoundingBox(STR_GRAPH_Y_LABEL).width;
 

	
 
		size->width  = std::max<uint>(size->width,  ScaleGUITrad(5) + y_label_width + this->num_on_x_axis * (x_label_width + ScaleGUITrad(5)) + ScaleGUITrad(9));
 
		size->width  = std::max<uint>(size->width,  ScaleGUITrad(5) + y_label_width + this->num_vert_lines * (x_label_width + ScaleGUITrad(5)) + ScaleGUITrad(9));
 
		size->height = std::max<uint>(size->height, ScaleGUITrad(5) + (1 + MIN_GRAPH_NUM_LINES_Y * 2 + (this->draw_dates ? 3 : 1)) * GetCharacterHeight(FS_SMALL) + ScaleGUITrad(4));
 
		size->height = std::max<uint>(size->height, size->width / 3);
 
	}
0 comments (0 inline, 0 general)