mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Switch (back) to our own Color type instead of using wxColour.
The reason is that wxColour's default constructor creates an invalid color (what is that even?). It is nicer to just have default be transparent.
This commit is contained in:
@@ -127,9 +127,13 @@ struct TextElementsFromString {
|
||||
else if (is_substr(text, tag_start, _( "<color"))) {
|
||||
size_t colon = text.find_first_of(_(">:"), tag_start);
|
||||
if (colon < pos - 1 && text.GetChar(colon) == _(':')) {
|
||||
Color c = parse_color(text.substr(colon+1, pos-colon-2));
|
||||
if (!c.Ok()) c = style.font.color;
|
||||
colors.push_back(c);
|
||||
auto c = parse_color(text.substr(colon+1, pos-colon-2));
|
||||
if (c) {
|
||||
colors.push_back(*c);
|
||||
} else {
|
||||
queue_message(MESSAGE_WARNING, _("Invalid color in tagged string: ") + text.substr(colon + 1, pos - colon - 2));
|
||||
colors.push_back(style.font.color);
|
||||
}
|
||||
}
|
||||
} else if (is_substr(text, tag_start, _("</color"))) {
|
||||
if (!colors.empty()) colors.pop_back();
|
||||
|
||||
Reference in New Issue
Block a user