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:
parent
d233dcce08
commit
8353df03a8
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue