summaryrefslogtreecommitdiff
path: root/Applications/PixelPaint/MoveTool.cpp
diff options
context:
space:
mode:
authorBenJilks <benjyjilks@gmail.com>2020-10-17 16:47:34 +0000
committerAndreas Kling <kling@serenityos.org>2020-11-22 16:07:00 +0100
commit1c27568ab0373c35bd33d0956658e8473efe181d (patch)
tree98ece9e48d2bd51c49de9da1ce0c992a3e988fc1 /Applications/PixelPaint/MoveTool.cpp
parent5aeab9878ebb3b9749be633e9d5812a3181141ca (diff)
downloadserenity-1c27568ab0373c35bd33d0956658e8473efe181d.zip
PixelPaint: Undo and redo actions
The most used feature of any image editor, undo. Each tool now notifies the ImageEditor that they completed an action, where it'll take a snapshot if its current state. For now, a snapshot is just a copy of the whole image and its layers. There's a hard limit on the amount of actions it stores.
Diffstat (limited to 'Applications/PixelPaint/MoveTool.cpp')
-rw-r--r--Applications/PixelPaint/MoveTool.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/Applications/PixelPaint/MoveTool.cpp b/Applications/PixelPaint/MoveTool.cpp
index cf6cea9975..ebeba5ba89 100644
--- a/Applications/PixelPaint/MoveTool.cpp
+++ b/Applications/PixelPaint/MoveTool.cpp
@@ -70,6 +70,7 @@ void MoveTool::on_mouseup(Layer&, GUI::MouseEvent& event, GUI::MouseEvent&)
return;
m_layer_being_moved = nullptr;
m_editor->window()->set_cursor(Gfx::StandardCursor::None);
+ m_editor->did_complete_action();
}
void MoveTool::on_keydown(GUI::KeyEvent& event)