Преглед изворни кода

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

Andreas Kling пре 4 година
родитељ
комит
8975caca45
1 измењених фајлова са 1 додато и 2 уклоњено
  1. 1 2
      Userland/Applications/PixelPaint/SprayTool.cpp

+ 1 - 2
Userland/Applications/PixelPaint/SprayTool.cpp

@@ -47,7 +47,6 @@ void SprayTool::paint_it()
     auto& bitmap = layer->bitmap();
     auto& bitmap = layer->bitmap();
     GUI::Painter painter(bitmap);
     GUI::Painter painter(bitmap);
     VERIFY(bitmap.bpp() == 32);
     VERIFY(bitmap.bpp() == 32);
-    m_editor->update();
     const double minimal_radius = 2;
     const double minimal_radius = 2;
     const double base_radius = minimal_radius * m_thickness;
     const double base_radius = minimal_radius * m_thickness;
     for (int i = 0; i < M_PI * base_radius * base_radius * (m_density / 100.0); i++) {
     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);
         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&)
 void SprayTool::on_mousedown(Layer&, GUI::MouseEvent& event, GUI::MouseEvent&)