mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:47:46 +00:00
PixelPaint: Move selection from ImageEditor to Image
This is preparation for making selection state undoable.
This commit is contained in:
parent
67596d9546
commit
d571159aeb
8 changed files with 70 additions and 32 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue