1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

PixelPaint: Disable bucket tool outside of the current selection

Previously, if the user clicked outside of the current selection with
the bucket tool, the selection would be filled.
This commit is contained in:
Tim Ledbetter 2022-12-14 18:02:00 +00:00 committed by Sam Atkins
parent d233dcce08
commit 8353df03a8

View file

@ -50,6 +50,9 @@ void BucketTool::on_mousedown(Layer* layer, MouseEvent& event)
if (!layer->rect().contains(layer_event.position()))
return;
if (auto selection = layer->image().selection(); !selection.is_empty() && !selection.is_selected(layer_event.position()))
return;
GUI::Painter painter(layer->get_scratch_edited_bitmap());
flood_fill(layer->get_scratch_edited_bitmap(), layer_event.position(), m_editor->color_for(layer_event), m_threshold);