diff options
author | frosch <frosch@openttd.org> | 2010-04-18 17:13:01 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2010-04-18 17:13:01 +0000 |
commit | af7051178de9f4b3eccbf9a4c0bd347e12a1f9dd (patch) | |
tree | 33dd7c5f98fa5caeffe3f8c477ef3a8da1d7c667 /src/gfx.cpp | |
parent | 2e90f7f8b975d380c3d544995ef6db9d6c8a86d8 (diff) | |
download | openttd-af7051178de9f4b3eccbf9a4c0bd347e12a1f9dd.tar.xz |
(svn r19671) -Fix (r19670): RoundDiv() needs to deal with signed numerators.
Diffstat (limited to 'src/gfx.cpp')
-rw-r--r-- | src/gfx.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp index 4c5177f21..fe0171598 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -550,7 +550,7 @@ static int DrawString(int left, int right, int top, char *str, const char *last, break; case SA_CENTER: - left = RoundDiv(initial_right + 1 + initial_left - w, 2); + left = RoundDivSU(initial_right + 1 + initial_left - w, 2); /* right + 1 = left + w */ right = left + w - 1; break; @@ -823,7 +823,7 @@ int DrawStringMultiLine(int left, int right, int top, int bottom, StringID str, total_height = (num + 1) * mt; } - int y = (align == SA_CENTER) ? RoundDiv(bottom + top - total_height, 2) : top; + int y = (align == SA_CENTER) ? RoundDivSU(bottom + top - total_height, 2) : top; const char *src = buffer; for (;;) { |