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

PixelPaint: Only update the layer thumbnail on layer bitmap changes

When a layer bitmap is modified, we don't have to repaint the whole
layer gadget in the layer list, only the little thumbnail. :^)
This commit is contained in:
Andreas Kling 2021-07-09 21:33:30 +02:00
parent 285f0383d4
commit fd898be51a
4 changed files with 16 additions and 5 deletions

View file

@ -231,11 +231,20 @@ void LayerListWidget::image_did_remove_layer(size_t layer_index)
relayout_gadgets();
}
void LayerListWidget::image_did_modify_layer(size_t layer_index)
void LayerListWidget::image_did_modify_layer_properties(size_t layer_index)
{
update(m_gadgets[layer_index].rect);
}
void LayerListWidget::image_did_modify_layer_bitmap(size_t layer_index)
{
Gfx::IntRect adjusted_rect;
Gfx::IntRect thumbnail_rect;
Gfx::IntRect text_rect;
get_gadget_rects(m_gadgets[layer_index], adjusted_rect, thumbnail_rect, text_rect);
update(thumbnail_rect);
}
void LayerListWidget::image_did_modify_layer_stack()
{
rebuild_gadgets();