diff options
author | Andreas Kling <kling@serenityos.org> | 2021-07-07 11:58:32 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-07 13:01:20 +0200 |
commit | 8975caca45d5ed15ffbff76db2c0421c49d567d5 (patch) | |
tree | 820747440affd8022138e8bc5b3cdc0258ed15dd /Userland/Applications | |
parent | e28b22c3165865889b3f583dfe7a288eb519b73d (diff) | |
download | serenity-8975caca45d5ed15ffbff76db2c0421c49d567d5.zip |
PixelPaint: Make SprayTool only invalidate the modified area :^)
Diffstat (limited to 'Userland/Applications')
-rw-r--r-- | Userland/Applications/PixelPaint/SprayTool.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Userland/Applications/PixelPaint/SprayTool.cpp b/Userland/Applications/PixelPaint/SprayTool.cpp index 28aa9d9c23..fcf47ab517 100644 --- a/Userland/Applications/PixelPaint/SprayTool.cpp +++ b/Userland/Applications/PixelPaint/SprayTool.cpp @@ -47,7 +47,6 @@ void SprayTool::paint_it() auto& bitmap = layer->bitmap(); GUI::Painter painter(bitmap); VERIFY(bitmap.bpp() == 32); - m_editor->update(); const double minimal_radius = 2; const double base_radius = minimal_radius * m_thickness; for (int i = 0; i < M_PI * base_radius * base_radius * (m_density / 100.0); i++) { @@ -62,7 +61,7 @@ void SprayTool::paint_it() bitmap.set_pixel<Gfx::StorageFormat::BGRA8888>(xpos, ypos, m_color); } - layer->did_modify_bitmap(); + layer->did_modify_bitmap(Gfx::IntRect::centered_on(m_last_pos, Gfx::IntSize(base_radius * 2, base_radius * 2))); } void SprayTool::on_mousedown(Layer&, GUI::MouseEvent& event, GUI::MouseEvent&) |