diff options
author | Tim Ledbetter <timledbetter@gmail.com> | 2023-02-27 22:36:14 +0000 |
---|---|---|
committer | Jelle Raaijmakers <jelle@gmta.nl> | 2023-03-26 00:21:29 +0100 |
commit | 55feecee3646f73b6aee6881fe2de8b2ab01c5be (patch) | |
tree | 9896aa6cf2ad19448dda4bef6e4546a88c9932f1 | |
parent | bdd5f36121701c79522ffd617a4ae64f172285d8 (diff) | |
download | serenity-55feecee3646f73b6aee6881fe2de8b2ab01c5be.zip |
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.
-rw-r--r-- | Userland/Applications/PixelPaint/Tools/WandSelectTool.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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); |