disable markup in labels if a colour is specified

this prevents making map labels appear to come from a different side
(again) fixes bug #13678: label color can be faked with WML markup
This commit is contained in:
Gunter Labes 2009-11-17 14:55:28 +00:00
parent fb9afbb4a7
commit 125888da9d

View file

@ -939,6 +939,9 @@ surface floating_label::create_surface()
text.set_font_size(font_size_);
text.set_maximum_width(clip_rect_.w);
text.set_maximum_height(clip_rect_.h);
// If a colour is specified don't allow to override it with markup. (prevents faking map labels for example)
// FIXME: @todo Better would be to only ignore colour markup or reset the colour after set_text().
if (colour_ != font::LABEL_COLOUR) use_markup_ = false;
text.set_text(text_, use_markup_);
surface foreground = text.render();