1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:17:44 +00:00

PixelPaint: Make BrushTool only invalidate the modified area :^)

This commit is contained in:
Andreas Kling 2021-07-07 11:48:16 +02:00
parent f33edd33cc
commit e28b22c316

View file

@ -39,7 +39,10 @@ void BrushTool::on_mousemove(Layer& layer, GUI::MouseEvent& event, GUI::MouseEve
return; return;
draw_line(layer.bitmap(), m_editor->color_for(event), m_last_position, event.position()); draw_line(layer.bitmap(), m_editor->color_for(event), m_last_position, event.position());
layer.did_modify_bitmap();
auto modified_rect = Gfx::IntRect::from_two_points(m_last_position, event.position()).inflated(m_size * 2, m_size * 2);
layer.did_modify_bitmap(modified_rect);
m_last_position = event.position(); m_last_position = event.position();
m_was_drawing = true; m_was_drawing = true;
} }