Index: settings_gui.cpp =================================================================== --- settings_gui.cpp (revision 20786) +++ settings_gui.cpp (working copy) @@ -383,7 +383,7 @@ case GOW_CURRENCY_DROPDOWN: // Currency if (index == CUSTOM_CURRENCY_ID) ShowCustCurrency(); this->opt->locale.currency = index; - MarkWholeScreenDirty(); + ReInitAllWindows(); break; case GOW_DISTANCE_DROPDOWN: // Measuring units Index: graph_gui.cpp =================================================================== --- graph_gui.cpp (revision 20786) +++ graph_gui.cpp (working copy) @@ -24,6 +24,7 @@ #include "sortlist_type.h" #include "core/geometry_func.hpp" #include "math.h" +#include "currency.h" #include "table/strings.h" #include "table/sprites.h" @@ -1356,10 +1357,27 @@ * but then you need at 1000 times more money. At that time you're * not that interested anymore in the last few digits anyway. */ uint max = 999999999; // nine 9s + /* Scale max for the display currency. Prior to rendering the value + * is converted into the display currency, which may cause it to + * raise significantly. We need to compensate for that since {{CURRCOMPACT}} + * is used, which can produce quite short renderings of very large + * values. Otherwise the calculated width could be too narrow. + * Note that it doesn't work if there was a currency with an exchange + * rate greater than max. */ + max /= _currency->rate; SetDParam(0, max); SetDParam(1, max); uint score_detail_width = GetStringBoundingBox(STR_PERFORMANCE_DETAIL_AMOUNT_CURRENCY).width; + /* The width is usually calculated with a value of 1.000.000k. Since + * italian lira has a quite large exchange rate the rounding error of + * the above scaling is a bit larger then and results in a value of + * 999.999k. The calculated space is two pixels too small for the actual + * values at a new game with the default font. + * Since we can't change max, it would break for the other currencies, + * we add another characters width. */ + score_detail_width += GetStringBoundingBox("9", FS_NORMAL).width; + size->width = 7 + score_info_width + 5 + this->bar_width + 5 + score_detail_width + 7; uint left = 7; uint right = size->width - 7;