1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:37:35 +00:00

PaintBrush: Show the layer stack in a table view on the right hand side

This commit is contained in:
Andreas Kling 2020-05-12 23:00:23 +02:00
parent 985c2550c1
commit 35c2d389f5
9 changed files with 187 additions and 0 deletions

View file

@ -27,6 +27,7 @@
#include "ImageEditor.h"
#include "Image.h"
#include "Layer.h"
#include "LayerModel.h"
#include <LibGUI/Painter.h>
#include <LibGfx/Palette.h>
@ -54,6 +55,18 @@ void ImageEditor::paint_event(GUI::PaintEvent& event)
if (m_image) {
m_image->paint_into(painter, m_image->rect(), m_image->rect());
}
if (m_active_layer) {
painter.draw_rect(m_active_layer->rect().inflated(2, 2), Color::Black);
}
}
void ImageEditor::set_active_layer(Layer* layer)
{
if (m_active_layer == layer)
return;
m_active_layer = layer;
update();
}
}