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

PixelPaint: Move selection from ImageEditor to Image

This is preparation for making selection state undoable.
This commit is contained in:
Andreas Kling 2022-08-25 20:50:15 +02:00
parent 67596d9546
commit d571159aeb
8 changed files with 70 additions and 32 deletions

View file

@ -8,6 +8,7 @@
#pragma once
#include "Selection.h"
#include <AK/HashTable.h>
#include <AK/JsonObjectSerializer.h>
#include <AK/NonnullRefPtrVector.h>
@ -55,6 +56,9 @@ public:
ErrorOr<NonnullRefPtr<Gfx::Bitmap>> try_compose_bitmap(Gfx::BitmapFormat format) const;
RefPtr<Gfx::Bitmap> try_copy_bitmap(Selection const&) const;
Selection& selection() { return m_selection; }
Selection const& selection() const { return m_selection; }
size_t layer_count() const { return m_layers.size(); }
Layer const& layer(size_t index) const { return m_layers.at(index); }
Layer& layer(size_t index) { return m_layers.at(index); }
@ -114,6 +118,8 @@ private:
NonnullRefPtrVector<Layer> m_layers;
HashTable<ImageClient*> m_clients;
Selection m_selection;
};
class ImageUndoCommand : public GUI::Command {