mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 02:45:07 +00:00
PixelPaint: Use UndoStack instead of History
This allows to share more code with other undo systems.
This commit is contained in:
parent
7707ebcd63
commit
a27d118085
7 changed files with 41 additions and 134 deletions
|
@ -312,4 +312,20 @@ void Image::did_change()
|
|||
client->image_did_change();
|
||||
}
|
||||
|
||||
ImageUndoCommand::ImageUndoCommand(Image& image)
|
||||
: m_snapshot(image.take_snapshot())
|
||||
, m_image(image)
|
||||
{
|
||||
}
|
||||
|
||||
void ImageUndoCommand::undo()
|
||||
{
|
||||
m_image.restore_snapshot(*m_snapshot);
|
||||
}
|
||||
|
||||
void ImageUndoCommand::redo()
|
||||
{
|
||||
undo();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue