summaryrefslogtreecommitdiff
path: root/src/gfx.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-03-25 01:10:24 +0000
committerrubidium <rubidium@openttd.org>2009-03-25 01:10:24 +0000
commit3e93f8adda5f23808e66a973b1dce8d7e7c24d0f (patch)
tree6a8fb50166f8edf977cbf51774333b5004a3a679 /src/gfx.cpp
parent4a500bbcdb5c1f3b8bfe8dcc454c2d07b210bf88 (diff)
downloadopenttd-3e93f8adda5f23808e66a973b1dce8d7e7c24d0f.tar.xz
(svn r15844) -Codechange: allow text alignment to be forced so the console and ai debug output don't get swapped (those are untranslateable anyways)
Diffstat (limited to 'src/gfx.cpp')
-rw-r--r--src/gfx.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index 8d1d3c6a1..c334d24db 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -426,7 +426,7 @@ static int DrawString(int left, int right, int top, char *str, const char *last,
continue;
}
- if (align != SA_LEFT) {
+ if ((align & SA_MASK) != SA_LEFT) {
DEBUG(grf, 1, "Using SETX and/or SETXY when not aligned to the left. Fixing alignment...");
align = SA_LEFT;
}
@@ -443,7 +443,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 (_dynlang.text_dir == TD_RTL && align != SA_CENTER) align = (StringAlignment)(align ^ 2);
+ if (!(align & SA_FORCE) && _dynlang.text_dir == TD_RTL && align != SA_CENTER) align ^= SA_RIGHT;
/* Now draw the parts. This is done in the reverse order so we can give the
* BiDi algorithm the room to replace characters. It also simplifies
@@ -470,7 +470,7 @@ 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) {
+ switch (align & SA_MASK) {
case SA_LEFT:
/* right + 1 = left + w */
left = initial_left + offset;