From 8353df03a8b095938eaea262e59687ed1892437b Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Wed, 14 Dec 2022 18:02:00 +0000 Subject: 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. --- Userland/Applications/PixelPaint/Tools/BucketTool.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Userland') 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); -- cgit v1.2.3