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:
parent
fb9afbb4a7
commit
125888da9d
1 changed files with 3 additions and 0 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue