summaryrefslogtreecommitdiff
path: root/src/viewport.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-05-30 15:32:37 +0000
committerfrosch <frosch@openttd.org>2010-05-30 15:32:37 +0000
commit4b7afccd46d99ecb80e91f5ae34948a706980d05 (patch)
tree18585c7612ecf9461eb3b910ad5eec6296c7eb45 /src/viewport.cpp
parent2224c9b515b2e63b7268221905772770352e5425 (diff)
downloadopenttd-4b7afccd46d99ecb80e91f5ae34948a706980d05.tar.xz
(svn r19911) -Codechange: Simplify text drawing by eliminating global variables and side effects. This also fixes the 'colour' parameter of DrawStringMultiLine().
Diffstat (limited to 'src/viewport.cpp')
-rw-r--r--src/viewport.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp
index e0b740ea0..62502802e 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -1187,9 +1187,7 @@ void ViewportSign::UpdatePosition(int center, int top, StringID str)
this->center = center;
/* zoomed out version */
- _cur_fontsize = FS_SMALL;
- this->width_small = VPSM_LEFT + Align(GetStringBoundingBox(buffer).width, 2) + VPSM_RIGHT;
- _cur_fontsize = FS_NORMAL;
+ this->width_small = VPSM_LEFT + Align(GetStringBoundingBox(buffer, FS_SMALL).width, 2) + VPSM_RIGHT;
this->MarkDirty();
}