mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +00:00
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.
This commit is contained in:
parent
bdd5f36121
commit
55feecee36
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue