summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/autoreplace_gui.cpp2
-rw-r--r--src/company_gui.cpp4
-rw-r--r--src/engine_gui.cpp2
-rw-r--r--src/fios_gui.cpp2
-rw-r--r--src/genworld_gui.cpp6
-rw-r--r--src/gfx.cpp16
-rw-r--r--src/gfx_func.h22
-rw-r--r--src/graph_gui.cpp4
-rw-r--r--src/misc_gui.cpp2
-rw-r--r--src/music_gui.cpp2
-rw-r--r--src/network/network_content_gui.cpp6
-rw-r--r--src/network/network_gui.cpp34
-rw-r--r--src/newgrf_gui.cpp2
-rw-r--r--src/news_gui.cpp2
-rw-r--r--src/station_gui.cpp6
-rw-r--r--src/statusbar_gui.cpp14
-rw-r--r--src/toolbar_gui.cpp8
-rw-r--r--src/vehicle_gui.cpp2
-rw-r--r--src/viewport.cpp2
-rw-r--r--src/widget.cpp16
20 files changed, 80 insertions, 74 deletions
diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp
index 35dccda5e..d4d1cb87f 100644
--- a/src/autoreplace_gui.cpp
+++ b/src/autoreplace_gui.cpp
@@ -327,7 +327,7 @@ public:
SetDParam(0, STR_REPLACE_NOT_REPLACING_VEHICLE_SELECTED);
}
- DrawString(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_BLACK_STRING, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_BLACK_STRING, TC_FROMSTRING, SA_HOR_CENTER);
break;
}
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index c1ab78811..a8a024bd6 100644
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -149,7 +149,7 @@ static void DrawCategories(const Rect &r)
{
int y = r.top;
- DrawString(r.left, r.right, y, STR_FINANCES_EXPENDITURE_INCOME_TITLE, TC_FROMSTRING, SA_CENTER, true);
+ DrawString(r.left, r.right, y, STR_FINANCES_EXPENDITURE_INCOME_TITLE, TC_FROMSTRING, SA_HOR_CENTER, true);
y += FONT_HEIGHT_NORMAL + EXP_LINESPACE;
int type = _settings_client.gui.expenses_layout;
@@ -1119,7 +1119,7 @@ class SelectCompanyManagerFaceWindow : public Window
/* Draw the value/bool in white (0xC). If the button clicked adds 1px to x and y text coordinates (IsWindowWidgetLowered()). */
DrawString(nwi_widget->pos_x + nwi_widget->IsLowered(), nwi_widget->pos_x + nwi_widget->current_x - 1 - nwi_widget->IsLowered(),
- nwi_widget->pos_y + 1 + nwi_widget->IsLowered(), str, TC_WHITE, SA_CENTER);
+ nwi_widget->pos_y + 1 + nwi_widget->IsLowered(), str, TC_WHITE, SA_HOR_CENTER);
}
}
diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp
index 7247450d6..448d9ee05 100644
--- a/src/engine_gui.cpp
+++ b/src/engine_gui.cpp
@@ -97,7 +97,7 @@ struct EnginePreviewWindow : Window {
y = DrawStringMultiLine(r.left, r.right, r.top, y, STR_ENGINE_PREVIEW_MESSAGE, TC_FROMSTRING, SA_CENTER) + WD_PAR_VSEP_WIDE;
SetDParam(0, engine);
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_ENGINE_NAME, TC_BLACK, SA_CENTER);
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_ENGINE_NAME, TC_BLACK, SA_HOR_CENTER);
y += FONT_HEIGHT_NORMAL;
DrawVehicleEngine(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, this->width >> 1, y + VEHICLE_SPACE / 2, engine, GetEnginePalette(engine, _local_company));
diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp
index ac7e2ab8b..8ee17d4bd 100644
--- a/src/fios_gui.cpp
+++ b/src/fios_gui.cpp
@@ -367,7 +367,7 @@ public:
case SLWW_DETAILS: {
GfxFillRect(r.left + WD_FRAMERECT_LEFT, r.top + WD_FRAMERECT_TOP,
r.right - WD_FRAMERECT_RIGHT, r.top + FONT_HEIGHT_NORMAL * 2 + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM, 0x0A);
- DrawString(r.left, r.right, r.top + FONT_HEIGHT_NORMAL / 2 + WD_FRAMERECT_TOP, STR_SAVELOAD_DETAIL_CAPTION, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left, r.right, r.top + FONT_HEIGHT_NORMAL / 2 + WD_FRAMERECT_TOP, STR_SAVELOAD_DETAIL_CAPTION, TC_FROMSTRING, SA_HOR_CENTER);
if (this->selected == NULL) break;
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp
index 230a60022..51396416d 100644
--- a/src/genworld_gui.cpp
+++ b/src/genworld_gui.cpp
@@ -1220,17 +1220,17 @@ struct GenerateProgressWindow : public Window {
DrawFrameRect(r.left, r.top, r.right, r.bottom, COLOUR_GREY, FR_BORDERONLY);
DrawFrameRect(r.left + 1, r.top + 1, (int)((r.right - r.left - 2) * _gws.percent / 100) + r.left + 1, r.bottom - 1, COLOUR_MAUVE, FR_NONE);
SetDParam(0, _gws.percent);
- DrawString(r.left, r.right, r.top + 5, STR_GENERATION_PROGRESS, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left, r.right, r.top + 5, STR_GENERATION_PROGRESS, TC_FROMSTRING, SA_HOR_CENTER);
break;
case GPWW_PROGRESS_TEXT:
/* Tell which class we are generating */
- DrawString(r.left, r.right, r.top, _gws.cls, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left, r.right, r.top, _gws.cls, TC_FROMSTRING, SA_HOR_CENTER);
/* And say where we are in that class */
SetDParam(0, _gws.current);
SetDParam(1, _gws.total);
- DrawString(r.left, r.right, r.top + FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL, STR_GENERATION_PROGRESS_NUM, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left, r.right, r.top + FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL, STR_GENERATION_PROGRESS_NUM, TC_FROMSTRING, SA_HOR_CENTER);
}
}
};
diff --git a/src/gfx.cpp b/src/gfx.cpp
index a151d3676..fa9611bf1 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -527,7 +527,7 @@ static int DrawString(int left, int right, int top, char *str, const char *last,
continue;
}
- if ((align & SA_MASK) != SA_LEFT) {
+ if ((align & SA_HOR_MASK) != SA_LEFT) {
DEBUG(grf, 1, "Using SETX and/or SETXY when not aligned to the left. Fixing alignment...");
/* For left alignment and change the left so it will roughly be in the
@@ -554,7 +554,7 @@ static int DrawString(int left, int right, int top, char *str, const char *last,
}
/* In case we have a RTL language we swap the alignment. */
- if (!(align & SA_FORCE) && _dynlang.text_dir == TD_RTL && align != SA_CENTER) align ^= SA_RIGHT;
+ if (!(align & SA_FORCE) && _dynlang.text_dir == TD_RTL && !(align & SA_STRIP) && (align & SA_HOR_MASK) != SA_HOR_CENTER) align ^= SA_RIGHT;
for (UChar **iter = setx_offsets.Begin(); iter != setx_offsets.End(); iter++) {
UChar *to_draw = *iter;
@@ -575,14 +575,14 @@ static int DrawString(int left, int right, int top, char *str, const char *last,
* seen as lastof(todraw) and width as lengthof(todraw). They differ by 1.
* So most +1/-1 additions are to move from lengthof to 'indices'.
*/
- switch (align & SA_MASK) {
+ switch (align & SA_HOR_MASK) {
case SA_LEFT:
/* right + 1 = left + w */
left = initial_left + offset;
right = left + w - 1;
break;
- case SA_CENTER:
+ case SA_HOR_CENTER:
left = RoundDivSU(initial_right + 1 + initial_left - w, 2);
/* right + 1 = left + w */
right = left + w - 1;
@@ -605,7 +605,7 @@ static int DrawString(int left, int right, int top, char *str, const char *last,
}
}
- return align == SA_RIGHT ? min_left : max_right;
+ return (align & SA_HOR_MASK) == SA_RIGHT ? min_left : max_right;
}
/**
@@ -824,9 +824,7 @@ Dimension GetStringMultiLineBoundingBox(StringID str, const Dimension &suggestio
* @param bottom The bottom most position to draw on.
* @param str String to draw.
* @param colour Colour used for drawing the string, see DoDrawString() for details
- * @param align The alignment of the string when drawing left-to-right. In the
- * case a right-to-left language is chosen this is inverted so it
- * will be drawn in the right direction.
+ * @param align The horizontal and vertical alignment of the string.
* @param underline Whether to underline all strings
*
* @return The bottom to where we have written.
@@ -857,7 +855,7 @@ int DrawStringMultiLine(int left, int right, int top, int bottom, StringID str,
total_height = (num + 1) * mt;
}
- int y = (align == SA_CENTER) ? RoundDivSU(bottom + top - total_height, 2) : top;
+ int y = ((align & SA_VERT_MASK) == SA_VERT_CENTER) ? RoundDivSU(bottom + top - total_height, 2) : top;
const char *src = buffer;
DrawStringParams params(colour);
diff --git a/src/gfx_func.h b/src/gfx_func.h
index d76e02f01..2c7b33dc8 100644
--- a/src/gfx_func.h
+++ b/src/gfx_func.h
@@ -93,18 +93,26 @@ void DrawSprite(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub
/** How to align the to-be drawn text. */
enum StringAlignment {
- SA_LEFT, ///< Left align the text
- SA_CENTER, ///< Center the text
- SA_RIGHT, ///< Right align the text
- SA_MASK = 3, ///< Mask for base alignment
- SA_FORCE = 4, ///< Force the alignment, i.e. don't swap for RTL languages.
- SA_STRIP = 8, ///< Strip the SETX/SETXY commands from the string
+ SA_LEFT = 0 << 0, ///< Left align the text.
+ SA_HOR_CENTER = 1 << 0, ///< Horizontally center the text.
+ SA_RIGHT = 2 << 0, ///< Right align the text (must be a single bit).
+ SA_HOR_MASK = 3 << 0, ///< Mask for horizontal alignment.
+
+ SA_TOP = 0 << 2, ///< Top align the text.
+ SA_VERT_CENTER = 1 << 2, ///< Vertically center the text.
+ SA_BOTTOM = 2 << 2, ///< Bottom align the text.
+ SA_VERT_MASK = 3 << 2, ///< Mask for vertical alignment.
+
+ SA_CENTER = SA_HOR_CENTER | SA_VERT_CENTER, ///< Center both horizontally and vertically.
+
+ SA_FORCE = 1 << 4, ///< Force the alignment, i.e. don't swap for RTL languages.
+ SA_STRIP = 1 << 5, ///< Strip the SETX/SETXY commands from the string
};
DECLARE_ENUM_AS_BIT_SET(StringAlignment)
int DrawString(int left, int right, int top, const char *str, TextColour colour = TC_FROMSTRING, StringAlignment align = SA_LEFT, bool underline = false);
int DrawString(int left, int right, int top, StringID str, TextColour colour = TC_FROMSTRING, StringAlignment align = SA_LEFT, bool underline = false);
-int DrawStringMultiLine(int left, int right, int top, int bottom, StringID str, TextColour colour = TC_FROMSTRING, StringAlignment align = SA_LEFT, bool underline = false);
+int DrawStringMultiLine(int left, int right, int top, int bottom, StringID str, TextColour colour = TC_FROMSTRING, StringAlignment align = (SA_TOP | SA_LEFT), bool underline = false);
void DrawCharCentered(uint32 c, int x, int y, TextColour colour);
diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp
index f07b52754..b4419d337 100644
--- a/src/graph_gui.cpp
+++ b/src/graph_gui.cpp
@@ -408,7 +408,7 @@ protected:
for (int i = 0; i < this->num_on_x_axis; i++) {
SetDParam(0, label);
- DrawString(x + 1, x + x_sep - 1, y, STR_GRAPH_Y_LABEL_NUMBER, graph_axis_label_colour, SA_CENTER);
+ DrawString(x + 1, x + x_sep - 1, y, STR_GRAPH_Y_LABEL_NUMBER, graph_axis_label_colour, SA_HOR_CENTER);
label += this->x_values_increment;
x += x_sep;
@@ -1439,7 +1439,7 @@ struct PerformanceRatingDetailWindow : Window {
/* Draw it */
SetDParam(0, Clamp(val, 0, needed) * 100 / needed);
- DrawString(this->bar_left, this->bar_right, text_top, STR_PERFORMANCE_DETAIL_PERCENT, TC_FROMSTRING, SA_CENTER);
+ DrawString(this->bar_left, this->bar_right, text_top, STR_PERFORMANCE_DETAIL_PERCENT, TC_FROMSTRING, SA_HOR_CENTER);
/* SCORE_LOAN is inversed */
if (score_type == SCORE_LOAN) val = needed - val;
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index ff40d9972..944ad703b 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -93,7 +93,7 @@ public:
for (uint i = 0; i < LAND_INFO_CENTERED_LINES; i++) {
if (StrEmpty(this->landinfo_data[i])) break;
- DrawString(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, y, this->landinfo_data[i], i == 0 ? TC_LIGHT_BLUE : TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, y, this->landinfo_data[i], i == 0 ? TC_LIGHT_BLUE : TC_FROMSTRING, SA_HOR_CENTER);
y += FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL;
if (i == 0) y += 4;
}
diff --git a/src/music_gui.cpp b/src/music_gui.cpp
index 5907da582..c141f4e1f 100644
--- a/src/music_gui.cpp
+++ b/src/music_gui.cpp
@@ -613,7 +613,7 @@ struct MusicWindow : public Window {
str = STR_MUSIC_TITLE_NAME;
SetDParamStr(0, GetSongName(_music_wnd_cursong - 1));
}
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, str, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, str, TC_FROMSTRING, SA_HOR_CENTER);
} break;
case MW_MUSIC_VOL: case MW_EFFECT_VOL: {
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index b2b15133c..78a589558 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -151,7 +151,7 @@ public:
SetDParam(0, this->downloaded_bytes);
SetDParam(1, this->total_bytes);
SetDParam(2, this->downloaded_bytes * 100LL / this->total_bytes);
- DrawString(r.left + 2, r.right - 2, y, STR_CONTENT_DOWNLOAD_PROGRESS_SIZE, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + 2, r.right - 2, y, STR_CONTENT_DOWNLOAD_PROGRESS_SIZE, TC_FROMSTRING, SA_HOR_CENTER);
StringID str;
if (this->downloaded_bytes == this->total_bytes) {
@@ -466,7 +466,7 @@ public:
DrawSprite(sprite, pal, nwi_checkbox->pos_x + (pal == PAL_NONE ? 2 : 3), y + sprite_y_offset + (pal == PAL_NONE ? 1 : 0));
StringID str = STR_CONTENT_TYPE_BASE_GRAPHICS + ci->type - CONTENT_TYPE_BASE_GRAPHICS;
- DrawString(nwi_type->pos_x, nwi_type->pos_x + nwi_type->current_x - 1, y + WD_MATRIX_TOP, str, TC_BLACK, SA_CENTER);
+ DrawString(nwi_type->pos_x, nwi_type->pos_x + nwi_type->current_x - 1, y + WD_MATRIX_TOP, str, TC_BLACK, SA_HOR_CENTER);
DrawString(nwi_name->pos_x + WD_FRAMERECT_LEFT, nwi_name->pos_x + nwi_name->current_x - WD_FRAMERECT_RIGHT, y + WD_MATRIX_TOP, ci->name, TC_BLACK);
y += this->resize.step_height;
@@ -488,7 +488,7 @@ public:
/* Create the nice grayish rectangle at the details top */
GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.top + DETAIL_TITLE_HEIGHT, 157);
- DrawString(r.left + WD_INSET_LEFT, r.right - WD_INSET_RIGHT, r.top + FONT_HEIGHT_NORMAL + WD_INSET_TOP, STR_CONTENT_DETAIL_TITLE, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + WD_INSET_LEFT, r.right - WD_INSET_RIGHT, r.top + FONT_HEIGHT_NORMAL + WD_INSET_TOP, STR_CONTENT_DETAIL_TITLE, TC_FROMSTRING, SA_HOR_CENTER);
/* Draw the total download size */
SetDParam(0, this->filesize_sum);
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index 95e98f285..d0e7a49ce 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -383,7 +383,7 @@ protected:
SetDParam(1, cur_item->info.clients_max);
SetDParam(2, cur_item->info.companies_on);
SetDParam(3, cur_item->info.companies_max);
- DrawString(nwi_clients->pos_x, nwi_clients->pos_x + nwi_clients->current_x - 1, y, STR_NETWORK_SERVER_LIST_GENERAL_ONLINE, TC_FROMSTRING, SA_CENTER);
+ DrawString(nwi_clients->pos_x, nwi_clients->pos_x + nwi_clients->current_x - 1, y, STR_NETWORK_SERVER_LIST_GENERAL_ONLINE, TC_FROMSTRING, SA_HOR_CENTER);
}
if (nwi_header->IsWidgetVisible(NGWW_MAPSIZE)) {
@@ -391,7 +391,7 @@ protected:
const NWidgetBase *nwi_mapsize = this->GetWidget<NWidgetBase>(NGWW_MAPSIZE);
SetDParam(0, cur_item->info.map_width);
SetDParam(1, cur_item->info.map_height);
- DrawString(nwi_mapsize->pos_x, nwi_mapsize->pos_x + nwi_mapsize->current_x - 1, y, STR_NETWORK_SERVER_LIST_MAP_SIZE_SHORT, TC_FROMSTRING, SA_CENTER);
+ DrawString(nwi_mapsize->pos_x, nwi_mapsize->pos_x + nwi_mapsize->current_x - 1, y, STR_NETWORK_SERVER_LIST_MAP_SIZE_SHORT, TC_FROMSTRING, SA_HOR_CENTER);
}
if (nwi_header->IsWidgetVisible(NGWW_DATE)) {
@@ -400,7 +400,7 @@ protected:
YearMonthDay ymd;
ConvertDateToYMD(cur_item->info.game_date, &ymd);
SetDParam(0, ymd.year);
- DrawString(nwi_date->pos_x, nwi_date->pos_x + nwi_date->current_x - 1, y, STR_JUST_INT, TC_BLACK, SA_CENTER);
+ DrawString(nwi_date->pos_x, nwi_date->pos_x + nwi_date->current_x - 1, y, STR_JUST_INT, TC_BLACK, SA_HOR_CENTER);
}
if (nwi_header->IsWidgetVisible(NGWW_YEARS)) {
@@ -410,7 +410,7 @@ protected:
ConvertDateToYMD(cur_item->info.game_date, &ymd_cur);
ConvertDateToYMD(cur_item->info.start_date, &ymd_start);
SetDParam(0, ymd_cur.year - ymd_start.year);
- DrawString(nwi_years->pos_x, nwi_years->pos_x + nwi_years->current_x - 1, y, STR_JUST_INT, TC_BLACK, SA_CENTER);
+ DrawString(nwi_years->pos_x, nwi_years->pos_x + nwi_years->current_x - 1, y, STR_JUST_INT, TC_BLACK, SA_HOR_CENTER);
}
/* Align the sprites */
@@ -596,16 +596,16 @@ public:
/* Draw the right menu */
GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.top + detail_height - 1, 157);
if (sel == NULL) {
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 6 + 4 + FONT_HEIGHT_NORMAL, STR_NETWORK_SERVER_LIST_GAME_INFO, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 6 + 4 + FONT_HEIGHT_NORMAL, STR_NETWORK_SERVER_LIST_GAME_INFO, TC_FROMSTRING, SA_HOR_CENTER);
} else if (!sel->online) {
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 6 + 4 + FONT_HEIGHT_NORMAL, sel->info.server_name, TC_ORANGE, SA_CENTER); // game name
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 6 + 4 + FONT_HEIGHT_NORMAL, sel->info.server_name, TC_ORANGE, SA_HOR_CENTER); // game name
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + detail_height + 4, STR_NETWORK_SERVER_LIST_SERVER_OFFLINE, TC_FROMSTRING, SA_CENTER); // server offline
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + detail_height + 4, STR_NETWORK_SERVER_LIST_SERVER_OFFLINE, TC_FROMSTRING, SA_HOR_CENTER); // server offline
} else { // show game info
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 6, STR_NETWORK_SERVER_LIST_GAME_INFO, TC_FROMSTRING, SA_CENTER);
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 6 + 4 + FONT_HEIGHT_NORMAL, sel->info.server_name, TC_ORANGE, SA_CENTER); // game name
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 6 + 8 + 2 * FONT_HEIGHT_NORMAL, sel->info.map_name, TC_BLACK, SA_CENTER); // map name
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 6, STR_NETWORK_SERVER_LIST_GAME_INFO, TC_FROMSTRING, SA_HOR_CENTER);
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 6 + 4 + FONT_HEIGHT_NORMAL, sel->info.server_name, TC_ORANGE, SA_HOR_CENTER); // game name
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 6 + 8 + 2 * FONT_HEIGHT_NORMAL, sel->info.map_name, TC_BLACK, SA_HOR_CENTER); // map name
uint16 y = r.top + detail_height + 4;
@@ -648,12 +648,12 @@ public:
y += WD_PAR_VSEP_NORMAL;
if (!sel->info.compatible) {
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, sel->info.version_compatible ? STR_NETWORK_SERVER_LIST_GRF_MISMATCH : STR_NETWORK_SERVER_LIST_VERSION_MISMATCH, TC_FROMSTRING, SA_CENTER); // server mismatch
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, sel->info.version_compatible ? STR_NETWORK_SERVER_LIST_GRF_MISMATCH : STR_NETWORK_SERVER_LIST_VERSION_MISMATCH, TC_FROMSTRING, SA_HOR_CENTER); // server mismatch
} else if (sel->info.clients_on == sel->info.clients_max) {
/* Show: server full, when clients_on == max_clients */
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_NETWORK_SERVER_LIST_SERVER_FULL, TC_FROMSTRING, SA_CENTER); // server full
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_NETWORK_SERVER_LIST_SERVER_FULL, TC_FROMSTRING, SA_HOR_CENTER); // server full
} else if (sel->info.use_password) {
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_NETWORK_SERVER_LIST_PASSWORD, TC_FROMSTRING, SA_CENTER); // password warning
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_NETWORK_SERVER_LIST_PASSWORD, TC_FROMSTRING, SA_HOR_CENTER); // password warning
}
}
}
@@ -1565,7 +1565,7 @@ struct NetworkLobbyWindow : public Window {
const int detail_height = 12 + FONT_HEIGHT_NORMAL + 12;
/* Draw info about selected company when it is selected in the left window */
GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.top + detail_height - 1, 157);
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 12, STR_NETWORK_GAME_LOBBY_COMPANY_INFO, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 12, STR_NETWORK_GAME_LOBBY_COMPANY_INFO, TC_FROMSTRING, SA_HOR_CENTER);
if (this->company == INVALID_COMPANY || StrEmpty(this->company_info[this->company].company_name)) return;
@@ -2153,7 +2153,7 @@ struct NetworkJoinStatusWindow : Window {
if (widget != NJSW_BACKGROUND) return;
uint8 progress; // used for progress bar
- DrawString(r.left + 2, r.right - 2, r.top + 20, STR_NETWORK_CONNECTING_1 + _network_join_status, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + 2, r.right - 2, r.top + 20, STR_NETWORK_CONNECTING_1 + _network_join_status, TC_FROMSTRING, SA_HOR_CENTER);
switch (_network_join_status) {
case NETWORK_JOIN_STATUS_CONNECTING: case NETWORK_JOIN_STATUS_AUTHORIZING:
case NETWORK_JOIN_STATUS_GETTING_COMPANY_INFO:
@@ -2161,13 +2161,13 @@ struct NetworkJoinStatusWindow : Window {
break;
case NETWORK_JOIN_STATUS_WAITING:
SetDParam(0, _network_join_waiting);
- DrawString(r.left + 2, r.right - 2, r.top + 20 + FONT_HEIGHT_NORMAL, STR_NETWORK_CONNECTING_WAITING, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + 2, r.right - 2, r.top + 20 + FONT_HEIGHT_NORMAL, STR_NETWORK_CONNECTING_WAITING, TC_FROMSTRING, SA_HOR_CENTER);
progress = 15; // third stage is 15%
break;
case NETWORK_JOIN_STATUS_DOWNLOADING:
SetDParam(0, _network_join_bytes);
SetDParam(1, _network_join_bytes_total);
- DrawString(r.left + 2, r.right - 2, r.top + 20 + FONT_HEIGHT_NORMAL, STR_NETWORK_CONNECTING_DOWNLOADING, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + 2, r.right - 2, r.top + 20 + FONT_HEIGHT_NORMAL, STR_NETWORK_CONNECTING_DOWNLOADING, TC_FROMSTRING, SA_HOR_CENTER);
/* Fallthrough */
default: // Waiting is 15%, so the resting receivement of map is maximum 70%
progress = 15 + _network_join_bytes * (100 - 15) / _network_join_bytes_total;
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index 20c07bddf..566bcbb4e 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -394,7 +394,7 @@ struct NewGRFWindow : public QueryStringBaseWindow {
case SNGRFS_NEWGRF_INFO_TITLE:
/* Create the nice grayish rectangle at the details top. */
GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, 157);
- DrawString(r.left, r.right, (r.top + r.bottom - FONT_HEIGHT_NORMAL) / 2, STR_NEWGRF_SETTINGS_INFO_TITLE, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left, r.right, (r.top + r.bottom - FONT_HEIGHT_NORMAL) / 2, STR_NEWGRF_SETTINGS_INFO_TITLE, TC_FROMSTRING, SA_HOR_CENTER);
break;
case SNGRFS_NEWGRF_INFO: {
diff --git a/src/news_gui.cpp b/src/news_gui.cpp
index fac55e719..7e899fe84 100644
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -1136,7 +1136,7 @@ struct MessageOptionsWindow : Window {
if (widget >= WIDGET_NEWSOPT_START_OPTION && widget < WIDGET_NEWSOPT_END_OPTION && (widget - WIDGET_NEWSOPT_START_OPTION) % MOS_WIDG_PER_SETTING == 1) {
/* Draw the string of each setting on each button. */
int i = (widget - WIDGET_NEWSOPT_START_OPTION) / MOS_WIDG_PER_SETTING;
- DrawString(r.left, r.right, r.top + 2, this->message_opt[_news_type_data[i].display], TC_BLACK, SA_CENTER);
+ DrawString(r.left, r.right, r.top + 2, this->message_opt[_news_type_data[i].display], TC_BLACK, SA_HOR_CENTER);
}
}
diff --git a/src/station_gui.cpp b/src/station_gui.cpp
index 9f8480e10..4fe500f64 100644
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -494,13 +494,13 @@ public:
case SLW_NOCARGOWAITING: {
int cg_ofst = this->IsWidgetLowered(widget) ? 2 : 1;
- DrawString(r.left + cg_ofst, r.right + cg_ofst, r.top + cg_ofst, STR_ABBREV_NONE, TC_BLACK, SA_CENTER);
+ DrawString(r.left + cg_ofst, r.right + cg_ofst, r.top + cg_ofst, STR_ABBREV_NONE, TC_BLACK, SA_HOR_CENTER);
break;
}
case SLW_CARGOALL: {
int cg_ofst = this->IsWidgetLowered(widget) ? 2 : 1;
- DrawString(r.left + cg_ofst, r.right + cg_ofst, r.top + cg_ofst, STR_ABBREV_ALL, TC_BLACK, SA_CENTER);
+ DrawString(r.left + cg_ofst, r.right + cg_ofst, r.top + cg_ofst, STR_ABBREV_ALL, TC_BLACK, SA_HOR_CENTER);
break;
}
@@ -516,7 +516,7 @@ public:
if (cs->IsValid()) {
int cg_ofst = HasBit(this->cargo_filter, cs->Index()) ? 2 : 1;
GfxFillRect(r.left + cg_ofst, r.top + cg_ofst, r.right - 2 + cg_ofst, r.bottom - 2 + cg_ofst, cs->rating_colour);
- DrawString(r.left + cg_ofst, r.right + cg_ofst, r.top + cg_ofst, cs->abbrev, TC_BLACK, SA_CENTER);
+ DrawString(r.left + cg_ofst, r.right + cg_ofst, r.top + cg_ofst, cs->abbrev, TC_BLACK, SA_HOR_CENTER);
}
}
break;
diff --git a/src/statusbar_gui.cpp b/src/statusbar_gui.cpp
index c83203212..430a397c6 100644
--- a/src/statusbar_gui.cpp
+++ b/src/statusbar_gui.cpp
@@ -140,7 +140,7 @@ struct StatusBarWindow : Window {
case SBW_LEFT:
/* Draw the date */
SetDParam(0, _date);
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, (_pause_mode || _settings_client.gui.status_long_date) ? STR_WHITE_DATE_LONG : STR_WHITE_DATE_SHORT, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, (_pause_mode || _settings_client.gui.status_long_date) ? STR_WHITE_DATE_LONG : STR_WHITE_DATE_SHORT, TC_FROMSTRING, SA_HOR_CENTER);
break;
case SBW_RIGHT: {
@@ -148,18 +148,18 @@ struct StatusBarWindow : Window {
const Company *c = Company::GetIfValid(_local_company);
if (c != NULL) {
SetDParam(0, c->money);
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_COMPANY_MONEY, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_COMPANY_MONEY, TC_FROMSTRING, SA_HOR_CENTER);
}
} break;
case SBW_MIDDLE:
/* Draw status bar */
if (this->saving) { // true when saving is active
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_STATUSBAR_SAVING_GAME, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_STATUSBAR_SAVING_GAME, TC_FROMSTRING, SA_HOR_CENTER);
} else if (_do_autosave) {
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_STATUSBAR_AUTOSAVE, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_STATUSBAR_AUTOSAVE, TC_FROMSTRING, SA_HOR_CENTER);
} else if (_pause_mode != PM_UNPAUSED) {
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_STATUSBAR_PAUSED, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_STATUSBAR_PAUSED, TC_FROMSTRING, SA_HOR_CENTER);
} else if (this->ticker_scroll < TICKER_STOP && FindWindowById(WC_NEWS_WINDOW, 0) == NULL && _statusbar_news_item != NULL && _statusbar_news_item->string_id != 0) {
/* Draw the scrolling news text */
if (!DrawScrollingStatusText(_statusbar_news_item, this->ticker_scroll, r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, r.bottom)) {
@@ -167,14 +167,14 @@ struct StatusBarWindow : Window {
if (Company::IsValidID(_local_company)) {
/* This is the default text */
SetDParam(0, _local_company);
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_STATUSBAR_COMPANY_NAME, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_STATUSBAR_COMPANY_NAME, TC_FROMSTRING, SA_HOR_CENTER);
}
}
} else {
if (Company::IsValidID(_local_company)) {
/* This is the default text */
SetDParam(0, _local_company);
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_STATUSBAR_COMPANY_NAME, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_STATUSBAR_COMPANY_NAME, TC_FROMSTRING, SA_HOR_CENTER);
}
}
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp
index b690f0ac9..e45076134 100644
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -1458,16 +1458,16 @@ public:
switch (widget) {
case TBSE_DATEPANEL:
SetDParam(0, ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1));
- DrawString(r.left, r.right, (this->height - FONT_HEIGHT_NORMAL) / 2, STR_WHITE_DATE_LONG, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left, r.right, (this->height - FONT_HEIGHT_NORMAL) / 2, STR_WHITE_DATE_LONG, TC_FROMSTRING, SA_HOR_CENTER);
break;
case TBSE_SPACERPANEL: {
int height = r.bottom - r.top;
if (height > 2 * FONT_HEIGHT_NORMAL) {
- DrawString(r.left, r.right, (height + 1) / 2 - FONT_HEIGHT_NORMAL, STR_SCENEDIT_TOOLBAR_OPENTTD, TC_FROMSTRING, SA_CENTER);
- DrawString(r.left, r.right, (height + 1) / 2, STR_SCENEDIT_TOOLBAR_SCENARIO_EDITOR, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left, r.right, (height + 1) / 2 - FONT_HEIGHT_NORMAL, STR_SCENEDIT_TOOLBAR_OPENTTD, TC_FROMSTRING, SA_HOR_CENTER);
+ DrawString(r.left, r.right, (height + 1) / 2, STR_SCENEDIT_TOOLBAR_SCENARIO_EDITOR, TC_FROMSTRING, SA_HOR_CENTER);
} else {
- DrawString(r.left, r.right, (height - FONT_HEIGHT_NORMAL) / 2, STR_SCENEDIT_TOOLBAR_SCENARIO_EDITOR, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left, r.right, (height - FONT_HEIGHT_NORMAL) / 2, STR_SCENEDIT_TOOLBAR_SCENARIO_EDITOR, TC_FROMSTRING, SA_HOR_CENTER);
}
} break;
}
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index 8eb3d66b9..121a6de41 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -2125,7 +2125,7 @@ public:
/* draw the flag plus orders */
DrawSprite(v->vehstatus & VS_STOPPED ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, PAL_NONE, WD_FRAMERECT_LEFT, r.top + WD_FRAMERECT_TOP);
- DrawString(r.left + WD_FRAMERECT_LEFT + 6, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, str, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + WD_FRAMERECT_LEFT + 6, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, str, TC_FROMSTRING, SA_HOR_CENTER);
}
virtual void OnClick(Point pt, int widget, int click_count)
diff --git a/src/viewport.cpp b/src/viewport.cpp
index 1a108924f..a3e2e6fe8 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -1363,7 +1363,7 @@ static void ViewportDrawStrings(DrawPixelInfo *dpi, const StringSpriteToDrawVect
}
}
- DrawString(x + VPSM_LEFT, x + w - 1 - VPSM_RIGHT, y + VPSM_TOP, ss->string, colour, SA_CENTER);
+ DrawString(x + VPSM_LEFT, x + w - 1 - VPSM_RIGHT, y + VPSM_TOP, ss->string, colour, SA_HOR_CENTER);
}
}
diff --git a/src/widget.cpp b/src/widget.cpp
index 298c7ab44..7ef3b7322 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -259,7 +259,7 @@ static inline void DrawLabel(const Rect &r, WidgetType type, bool clicked, Strin
if ((type & WWT_MASK) == WWT_TEXTBTN_2 && clicked) str++;
Dimension d = GetStringBoundingBox(str);
int offset = max(0, ((int)(r.bottom - r.top + 1) - (int)d.height) / 2); // Offset for rendering the text vertically centered
- DrawString(r.left + clicked, r.right + clicked, r.top + offset + clicked, str, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + clicked, r.right + clicked, r.top + offset + clicked, str, TC_FROMSTRING, SA_HOR_CENTER);
}
/**
@@ -346,10 +346,10 @@ static inline void DrawVerticalScrollbar(const Rect &r, Colours colour, bool up_
{
/* draw up/down buttons */
DrawFrameRect(r.left, r.top, r.right, r.top + 9, colour, (up_clicked) ? FR_LOWERED : FR_NONE);
- DrawString(r.left + up_clicked, r.right + up_clicked, r.top + up_clicked, UPARROW, TC_BLACK, SA_CENTER);
+ DrawString(r.left + up_clicked, r.right + up_clicked, r.top + up_clicked, UPARROW, TC_BLACK, SA_HOR_CENTER);
DrawFrameRect(r.left, r.bottom - 9, r.right, r.bottom, colour, (down_clicked) ? FR_LOWERED : FR_NONE);
- DrawString(r.left + down_clicked, r.right + down_clicked, r.bottom - 9 + down_clicked, DOWNARROW, TC_BLACK, SA_CENTER);
+ DrawString(r.left + down_clicked, r.right + down_clicked, r.bottom - 9 + down_clicked, DOWNARROW, TC_BLACK, SA_HOR_CENTER);
int c1 = _colour_gradient[colour & 0xF][3];
int c2 = _colour_gradient[colour & 0xF][7];
@@ -516,7 +516,7 @@ static inline void DrawCloseBox(const Rect &r, Colours colour, StringID str)
{
assert(str == STR_BLACK_CROSS || str == STR_SILVER_CROSS); // black or silver cross
DrawFrameRect(r.left, r.top, r.right, r.bottom, colour, FR_NONE);
- DrawString(r.left + WD_CLOSEBOX_LEFT, r.right - WD_CLOSEBOX_RIGHT, r.top + WD_CLOSEBOX_TOP, str, TC_FROMSTRING, SA_CENTER);
+ DrawString(r.left + WD_CLOSEBOX_LEFT, r.right - WD_CLOSEBOX_RIGHT, r.top + WD_CLOSEBOX_TOP, str, TC_FROMSTRING, SA_HOR_CENTER);
}
/**
@@ -535,7 +535,7 @@ void DrawCaption(const Rect &r, Colours colour, Owner owner, StringID str)
GfxFillRect(r.left + 2, r.top + 2, r.right - 2, r.bottom - 2, _colour_gradient[_company_colours[owner]][4]);
}
- if (str != STR_NULL) DrawString(r.left + WD_CAPTIONTEXT_LEFT, r.right - WD_CAPTIONTEXT_RIGHT, r.top + WD_CAPTIONTEXT_TOP, str, TC_FROMSTRING, SA_CENTER);
+ if (str != STR_NULL) DrawString(r.left + WD_CAPTIONTEXT_LEFT, r.right - WD_CAPTIONTEXT_RIGHT, r.top + WD_CAPTIONTEXT_TOP, str, TC_FROMSTRING, SA_HOR_CENTER);
}
/**
@@ -553,12 +553,12 @@ static inline void DrawButtonDropdown(const Rect &r, Colours colour, bool clicke
if (_dynlang.text_dir == TD_LTR) {
DrawFrameRect(r.left, r.top, r.right - 12, r.bottom, colour, clicked_button ? FR_LOWERED : FR_NONE);
DrawFrameRect(r.right - 11, r.top, r.right, r.bottom, colour, clicked_dropdown ? FR_LOWERED : FR_NONE);
- DrawString(r.right - (clicked_dropdown ? 10 : 11), r.right, r.top + (clicked_dropdown ? 2 : 1), DOWNARROW, TC_BLACK, SA_CENTER);
+ DrawString(r.right - (clicked_dropdown ? 10 : 11), r.right, r.top + (clicked_dropdown ? 2 : 1), DOWNARROW, TC_BLACK, SA_HOR_CENTER);
if (str != STR_NULL) DrawString(r.left + WD_DROPDOWNTEXT_LEFT + clicked_button, r.right - WD_DROPDOWNTEXT_RIGHT + clicked_button, r.top + WD_DROPDOWNTEXT_TOP + clicked_button, str, TC_BLACK);
} else {
DrawFrameRect(r.left + 12, r.top, r.right, r.bottom, colour, clicked_button ? FR_LOWERED : FR_NONE);
DrawFrameRect(r.left, r.top, r.left + 11, r.bottom, colour, clicked_dropdown ? FR_LOWERED : FR_NONE);
- DrawString(r.left + clicked_dropdown, r.left + 11, r.top + (clicked_dropdown ? 2 : 1), DOWNARROW, TC_BLACK, SA_CENTER);
+ DrawString(r.left + clicked_dropdown, r.left + 11, r.top + (clicked_dropdown ? 2 : 1), DOWNARROW, TC_BLACK, SA_HOR_CENTER);
if (str != STR_NULL) DrawString(r.left + WD_DROPDOWNTEXT_RIGHT + clicked_button, r.right - WD_DROPDOWNTEXT_LEFT + clicked_button, r.top + WD_DROPDOWNTEXT_TOP + clicked_button, str, TC_BLACK);
}
}
@@ -603,7 +603,7 @@ void Window::DrawSortButtonState(int widget, SortButtonState state) const
int base = offset + nwid->pos_x + (_dynlang.text_dir == TD_LTR ? nwid->current_x - WD_SORTBUTTON_ARROW_WIDTH : 0);
int top = nwid->pos_y;
- DrawString(base, base + WD_SORTBUTTON_ARROW_WIDTH, top + 1 + offset, state == SBS_DOWN ? DOWNARROW : UPARROW, TC_BLACK, SA_CENTER);
+ DrawString(base, base + WD_SORTBUTTON_ARROW_WIDTH, top + 1 + offset, state == SBS_DOWN ? DOWNARROW : UPARROW, TC_BLACK, SA_HOR_CENTER);
}