diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2021-02-13 21:18:03 +0000 |
---|---|---|
committer | Charles Pigott <charlespigott@googlemail.com> | 2021-02-13 22:15:25 +0000 |
commit | 8121706b89998769fc37c02e89205ca414358f82 (patch) | |
tree | 5d345c4b5e0e66b167358a7d3f1f6a8a88d28002 /src | |
parent | 2b08f21625da0c0425bc8f5843b802f84b72a0b6 (diff) | |
download | openttd-8121706b89998769fc37c02e89205ca414358f82.tar.xz |
Fix #8620: Scale spacing between date & news in history window according to font scaling
Diffstat (limited to 'src')
-rw-r--r-- | src/news_gui.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 639c07574..3412c351c 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -34,6 +34,7 @@ #include "settings_internal.h" #include "guitimer_func.h" #include "group_gui.h" +#include "zoom_func.h" #include "widgets/news_widget.h" @@ -1174,8 +1175,8 @@ struct MessageHistoryWindow : Window { bool rtl = _current_text_dir == TD_RTL; uint date_left = rtl ? r.right - WD_FRAMERECT_RIGHT - this->date_width : r.left + WD_FRAMERECT_LEFT; uint date_right = rtl ? r.right - WD_FRAMERECT_RIGHT : r.left + WD_FRAMERECT_LEFT + this->date_width; - uint news_left = rtl ? r.left + WD_FRAMERECT_LEFT : r.left + WD_FRAMERECT_LEFT + this->date_width + WD_FRAMERECT_RIGHT; - uint news_right = rtl ? r.right - WD_FRAMERECT_RIGHT - this->date_width - WD_FRAMERECT_RIGHT : r.right - WD_FRAMERECT_RIGHT; + uint news_left = rtl ? r.left + WD_FRAMERECT_LEFT : r.left + WD_FRAMERECT_LEFT + this->date_width + WD_FRAMERECT_RIGHT + ScaleFontTrad(5); + uint news_right = rtl ? r.right - WD_FRAMERECT_RIGHT - this->date_width - WD_FRAMERECT_RIGHT - ScaleFontTrad(5) : r.right - WD_FRAMERECT_RIGHT; for (int n = this->vscroll->GetCapacity(); n > 0; n--) { SetDParam(0, ni->date); DrawString(date_left, date_right, y, STR_SHORT_DATE); |