History

History tool can be used to undo/redo, get/load editor state, add current editor state to history and more.

var pixie = new Pixie({
    onLoad: function() {
        pixie.tools.history.add('my history item', 'some icon');
    }
});

Methods

undo

Undo last canvas operation.

undo(): Promise

redo

Redo last canvas operation.

redo(): Promise

canUndo

Check if there are any actions to undo.

canUndo(): boolean

canRedo

Check if there are any actions to redo.

canRedo(): boolean

reload

Reload current history state, undoing any actions that were not yet applied.

reload(): Promise

replaceCurrent

Replace current history item with current canvas state.

replaceCurrent(): void

addHistoryItem

Create a new history item from current canvas state.

addHistoryItem(params: { name: HistoryName; state?: SerializedPixieState }): void

load

Replace current canvas state with specified history item.

load(item: HistoryItem): Promise