EditHistory<TPixel>¶
Namespace Nfty.Core.Editing in assembly Nfty.Core.
Undo/redo stack of reversible edit commands over one surface.
Type parameters
TPixel- The pixel that surface stores.
Constructors¶
EditHistory()¶
Properties¶
CanRedo¶
Whether an undone command is available to reapply.
CanUndo¶
Whether there is an applied command to undo.
Methods¶
Do(IEditCommand<TPixel>, IEditSurface<TPixel>)¶
Applies cmd and records it for undo. A no-op edit (Apply reports no pixel changed) is not recorded and returns false, so CanUndo does not light for an edit that produced nothing.
Parameters
cmd(IEditCommand<TPixel>) - The edit to apply.surface(IEditSurface<TPixel>) - The surface to edit.
Returns. True when the edit changed something and was recorded.
Redo(IEditSurface<TPixel>)¶
Reapplies the most recently undone command.
Parameters
surface(IEditSurface<TPixel>) - The surface to edit.
Undo(IEditSurface<TPixel>)¶
Undoes the most recent command.
Parameters
surface(IEditSurface<TPixel>) - The surface to restore.