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.
pull/661/head
Peter Nelson 4 months ago committed by GitHub
parent cb13ee90ef
commit d9461e52af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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);
}

Loading…
Cancel
Save