diff options
author | Tim Ledbetter <timledbetter@gmail.com> | 2022-12-14 18:02:00 +0000 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2022-12-16 08:10:33 +0000 |
commit | 8353df03a8b095938eaea262e59687ed1892437b (patch) | |
tree | 2a46a5e5b0ee15152d71d2409403ea6634e54e72 | |
parent | d233dcce085e046a68cb25ba4dd626ad5fbb9add (diff) | |
download | serenity-8353df03a8b095938eaea262e59687ed1892437b.zip |
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.
-rw-r--r-- | Userland/Applications/PixelPaint/Tools/BucketTool.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Applications/PixelPaint/Tools/BucketTool.cpp b/Userland/Applications/PixelPaint/Tools/BucketTool.cpp index 857239c5d6..b48480004c 100644 --- a/Userland/Applications/PixelPaint/Tools/BucketTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/BucketTool.cpp @@ -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); |