From bd2f4b9a244e0547103aad3a9e9ee53a89e27d83 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 27 Jun 2013 15:22:19 +0000 Subject: [PATCH] (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 --- src/gfx_layout.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp index 4148d05489..62fb75bc9d 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. */