From 55feecee3646f73b6aee6881fe2de8b2ab01c5be Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Mon, 27 Feb 2023 22:36:14 +0000 Subject: [PATCH] PixelPaint: Make wand tool work when layer and image rects differ Previously, the position of the mask used to calculate the new selection did not match the position of the active layer. The program would crash when trying to set a mask pixel outside the bounds of the active layer. --- Userland/Applications/PixelPaint/Tools/WandSelectTool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Applications/PixelPaint/Tools/WandSelectTool.cpp b/Userland/Applications/PixelPaint/Tools/WandSelectTool.cpp index 74dbb0c019..c7fe74a2fc 100644 --- a/Userland/Applications/PixelPaint/Tools/WandSelectTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/WandSelectTool.cpp @@ -25,7 +25,7 @@ static void set_flood_selection(Gfx::Bitmap& bitmap, Image& image, Gfx::IntPoint { VERIFY(bitmap.bpp() == 32); - Mask selection_mask = Mask::empty(bitmap.rect()); + auto selection_mask = Mask::empty({ selection_offset, bitmap.size() }); auto pixel_reached = [&](Gfx::IntPoint location) { selection_mask.set(selection_offset.x() + location.x(), selection_offset.y() + location.y(), 0xFF);