diff --git a/aegisub/src/command/edit.cpp b/aegisub/src/command/edit.cpp index ca024cfc1..547ede1f1 100644 --- a/aegisub/src/command/edit.cpp +++ b/aegisub/src/command/edit.cpp @@ -289,7 +289,9 @@ void show_color_picker(const agi::Context *c, agi::Color (AssStyle::*field), con int blockn = block_at_pos(line->Text, sel_start); int initial_sel_start = sel_start, initial_sel_end = sel_end; + int a = get_value(blocks, blockn, (int)color.a, alpha, "\\alpha"); color = get_value(blocks, blockn, color, tag, alt); + color.a = a; int commit_id = -1; bool ok = GetColorFromUser(c->parent, color, true, [&](agi::Color new_color) { set_tag(line, blocks, tag, new_color.GetAssOverrideFormatted(), sel_start, sel_end); diff --git a/aegisub/src/dialog_colorpicker.cpp b/aegisub/src/dialog_colorpicker.cpp index 66d2210b4..538e4fa4b 100644 --- a/aegisub/src/dialog_colorpicker.cpp +++ b/aegisub/src/dialog_colorpicker.cpp @@ -722,7 +722,16 @@ DialogColorPicker::~DialogColorPicker() { if (screen_dropper_icon->HasCapture()) screen_dropper_icon->ReleaseMouse(); } +static void change_value(wxSpinCtrl *ctrl, int value) { + wxEventBlocker blocker(ctrl); + ctrl->SetValue(value); +} + void DialogColorPicker::SetColor(agi::Color new_color) { + change_value(alpha_input, new_color.a); + alpha_slider->SetXY(0, new_color.a); + cur_color.a = new_color.a; + SetRGB(new_color); spectrum_dirty = true; UpdateFromRGB(); @@ -733,11 +742,6 @@ void DialogColorPicker::AddColorToRecent() { OPT_SET("Tool/Colour Picker/Recent Colours")->SetListColor(recent_box->Save()); } -static void change_value(wxSpinCtrl *ctrl, int value) { - wxEventBlocker blocker(ctrl); - ctrl->SetValue(value); -} - void DialogColorPicker::SetRGB(agi::Color new_color) { change_value(rgb_input[0], new_color.r); change_value(rgb_input[1], new_color.g);