mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:07:34 +00:00
PixelPaint: Make BrushTool only invalidate the modified area :^)
This commit is contained in:
parent
f33edd33cc
commit
e28b22c316
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue