Fix crash with empty patch-names.

An empty text will not produce a bounding box.
This commit is contained in:
Robin Gareus 2016-10-29 03:13:59 +02:00
parent c5d4900ea4
commit 5ed764178a

View File

@ -72,7 +72,11 @@ Flag::set_font_description (Pango::FontDescription font_description)
void
Flag::set_text (string const & text)
{
_text->set (text);
if (text.empty ()) {
_text->set (" ");
} else {
_text->set (text);
}
boost::optional<Rect> bbox = _text->bounding_box ();
assert (bbox);