PixelPaint: ColorPicker updates user colors while dragging

Now the user can hold primary and/or secondary mouse buttons
and move the mouse around while previewing the color on the
statusbar and fine tune their selection. The color will update
live so the color selected when mouse is released is the final
color used.
This commit is contained in:
Cody Hein 2022-12-13 22:25:17 -07:00 committed by Andrew Kaster
commit ab8522aa17
Notes: sideshowbarker 2024-07-17 20:33:50 +09:00
3 changed files with 22 additions and 2 deletions

View file

@ -350,9 +350,9 @@ void ImageEditor::set_editor_color_to_color_at_mouse_position(GUI::MouseEvent co
if (!color.alpha())
return;
if (event.button() == GUI::MouseButton::Primary)
if (event.buttons() & GUI::MouseButton::Primary)
set_primary_color(color);
else if (event.button() == GUI::MouseButton::Secondary)
if (event.buttons() & GUI::MouseButton::Secondary)
set_secondary_color(color);
}