Only add alpha tags if the user actually changes the alpha

This commit is contained in:
Thomas Goyne 2013-01-13 11:24:45 -08:00
parent 9e37e0897f
commit 50baf2d97f

View file

@ -312,7 +312,10 @@ void show_color_picker(const agi::Context *c, agi::Color (AssStyle::*field), con
int commit_id = -1; int commit_id = -1;
bool ok = GetColorFromUser(c->parent, color, true, [&](agi::Color new_color) { bool ok = GetColorFromUser(c->parent, color, true, [&](agi::Color new_color) {
set_tag(line, blocks, tag, new_color.GetAssOverrideFormatted(), sel_start, sel_end); set_tag(line, blocks, tag, new_color.GetAssOverrideFormatted(), sel_start, sel_end);
set_tag(line, blocks, alpha, str(boost::format("&H%02X&") % (int)new_color.a), sel_start, sel_end); if (new_color.a != color.a) {
set_tag(line, blocks, alpha, str(boost::format("&H%02X&") % (int)new_color.a), sel_start, sel_end);
color.a = new_color.a;
}
commit_text(c, _("set color"), sel_start, sel_end, &commit_id); commit_text(c, _("set color"), sel_start, sel_end, &commit_id);
}); });
commit_text(c, _("set color"), -1, -1, &commit_id); commit_text(c, _("set color"), -1, -1, &commit_id);