summaryrefslogtreecommitdiff
path: root/src/gfx_layout.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-06-27 15:22:19 +0000
committerrubidium <rubidium@openttd.org>2013-06-27 15:22:19 +0000
commitbd2f4b9a244e0547103aad3a9e9ee53a89e27d83 (patch)
treea892f6dc565933e4fe8134f9b4c9d774909bfad7 /src/gfx_layout.cpp
parent0150ab1bb24e351a566a98c107a57b4f25265a45 (diff)
downloadopenttd-bd2f4b9a244e0547103aad3a9e9ee53a89e27d83.tar.xz
(svn r25481) -Fix [FS#5620]: when the font size and colour change directly after eachother in a string, the latter isn't taken into account
Diffstat (limited to 'src/gfx_layout.cpp')
-rw-r--r--src/gfx_layout.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp
index 4148d0548..62fb75bc9 100644
--- a/src/gfx_layout.cpp
+++ b/src/gfx_layout.cpp
@@ -420,8 +420,10 @@ Layouter::Layouter(const char *str, int maxw, TextColour colour, FontSize fontsi
if (!this->fonts.Contains(buff - this->buffer)) {
this->fonts.Insert(buff - this->buffer, f);
- f = new Font(fontsize, cur_colour);
+ } else {
+ delete f;
}
+ f = new Font(fontsize, cur_colour);
}
/* Better safe than sorry. */