PixelPaint: Split bitmap() of Layer into {content, display}_bitmap

This is in preparation to support masking of Layers. We now distinguish
between the "display_bitmap" which will be the whole Layer with every
effect applied and the "content_bitmap" which contains the actual
unmodified pixels in the Layer.
This commit is contained in:
Tobias Christiansen 2022-03-07 21:24:05 +01:00 committed by Andreas Kling
commit 31a9196bfe
Notes: sideshowbarker 2024-07-17 21:16:31 +09:00
14 changed files with 73 additions and 42 deletions

View file

@ -82,10 +82,10 @@ void BucketTool::on_mousedown(Layer* layer, MouseEvent& event)
if (!layer->rect().contains(layer_event.position()))
return;
GUI::Painter painter(layer->bitmap());
auto target_color = layer->bitmap().get_pixel(layer_event.x(), layer_event.y());
GUI::Painter painter(layer->content_bitmap());
auto target_color = layer->content_bitmap().get_pixel(layer_event.x(), layer_event.y());
flood_fill(layer->bitmap(), layer_event.position(), target_color, m_editor->color_for(layer_event), m_threshold);
flood_fill(layer->content_bitmap(), layer_event.position(), target_color, m_editor->color_for(layer_event), m_threshold);
layer->did_modify_bitmap();
m_editor->did_complete_action();