Undoable pixel edit on one graphics sheet. More...
#include <graphics_undo_actions.h>
Public Member Functions | |
| GraphicsPixelEditAction (GraphicsEditorState *state, SheetPixelDiff diff, std::string description) | |
| absl::Status | Undo () override |
| absl::Status | Redo () override |
| std::string | Description () const override |
| Human-readable description (e.g., "Paint 12 tiles on map 5") | |
| size_t | MemoryUsage () const override |
| Approximate memory footprint for budget enforcement. | |
| bool | CanMergeWith (const UndoAction &) const override |
| const SheetPixelDiff & | diff () const |
Public Member Functions inherited from yaze::editor::UndoAction | |
| virtual | ~UndoAction ()=default |
| virtual void | MergeWith (UndoAction &) |
Private Attributes | |
| GraphicsEditorState * | state_ |
| SheetPixelDiff | diff_ |
| std::string | description_ |
Undoable pixel edit on one graphics sheet.
Holds only the pixels the edit changed. Undo and Redo write them through the session's GraphicsSheetStore (graphics_sheet_sync.h), which refreshes the Arena copy and marks the sheet modified.
Definition at line 25 of file graphics_undo_actions.h.
|
inline |
Definition at line 27 of file graphics_undo_actions.h.
|
inlineoverridevirtual |
Implements yaze::editor::UndoAction.
Definition at line 33 of file graphics_undo_actions.h.
References yaze::editor::ApplySheetPixelDiff(), diff_, and state_.
|
inlineoverridevirtual |
Implements yaze::editor::UndoAction.
Definition at line 36 of file graphics_undo_actions.h.
References yaze::editor::ApplySheetPixelDiff(), diff_, and state_.
|
inlineoverridevirtual |
Human-readable description (e.g., "Paint 12 tiles on map 5")
Implements yaze::editor::UndoAction.
Definition at line 40 of file graphics_undo_actions.h.
References description_.
|
inlineoverridevirtual |
Approximate memory footprint for budget enforcement.
Reimplemented from yaze::editor::UndoAction.
Definition at line 41 of file graphics_undo_actions.h.
References diff_, and yaze::editor::SheetPixelDiff::MemoryUsage().
|
inlineoverridevirtual |
Whether this action can merge with the previous action on the stack. Called only when both actions have the same concrete type.
Reimplemented from yaze::editor::UndoAction.
Definition at line 43 of file graphics_undo_actions.h.
|
inline |
Definition at line 48 of file graphics_undo_actions.h.
References diff_.
|
private |
Definition at line 51 of file graphics_undo_actions.h.
|
private |
Definition at line 52 of file graphics_undo_actions.h.
Referenced by diff(), MemoryUsage(), Redo(), and Undo().
|
private |
Definition at line 53 of file graphics_undo_actions.h.
Referenced by Description().