Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2021
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.77 KB | None | 0 0
  1. index f8e42c6a1..e4cfd68d2 100644
  2. --- a/src/graph_gui.cpp
  3. +++ b/src/graph_gui.cpp
  4. @@ -330,16 +330,6 @@ protected:
  5.                 /* Draw the background of the graph itself. */
  6.                 GfxFillRect(r.left, r.top, r.right, r.bottom, GRAPH_BASE_COLOUR);
  7.  
  8. -               /* Draw the vertical grid lines. */
  9. -
  10. -               /* Don't draw the first line, as that's where the axis will be. */
  11. -               x = r.left + x_sep;
  12. -
  13. -               for (int i = 0; i < this->num_vert_lines; i++) {
  14. -                       GfxFillRect(x, r.top, x, r.bottom, GRAPH_GRID_COLOUR);
  15. -                       x += x_sep;
  16. -               }
  17. -
  18.                 /* Draw the horizontal grid lines. */
  19.                 y = r.bottom;
  20.  
  21. @@ -384,9 +374,11 @@ protected:
  22.                         byte month = this->month;
  23.                         Year year  = this->year;
  24.                         for (int i = 0; i < this->num_on_x_axis; i++) {
  25. -                               SetDParam(0, month + STR_MONTH_ABBREV_JAN);
  26. -                               SetDParam(1, year);
  27. -                               DrawStringMultiLine(x, x + x_sep, y, this->height, month == 0 ? STR_GRAPH_X_LABEL_MONTH_YEAR : STR_GRAPH_X_LABEL_MONTH, graph_axis_label_colour, SA_LEFT);
  28. +                               if (i > 0) {
  29. +                                       SetDParam(0, month + STR_MONTH_ABBREV_JAN);
  30. +                                       SetDParam(1, year);
  31. +                                       DrawStringMultiLine(x - x_sep / 2 , x + x_sep / 2, y, this->height, month == 6 ? STR_GRAPH_X_LABEL_MONTH_YEAR : STR_GRAPH_X_LABEL_MONTH, graph_axis_label_colour, SA_HOR_CENTER);
  32. +                               }
  33.  
  34.                                 month += 3;
  35.                                 if (month >= 12) {
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement