canvas-editor-engine 1.1.47 → 1.1.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IHistoryLine } from "../types/history";
|
|
2
|
+
import { Project } from "../types/project";
|
|
2
3
|
export default class ThroughHistoryService {
|
|
3
4
|
static cache: IHistoryLine[];
|
|
4
5
|
static current(): IHistoryLine;
|
|
@@ -6,5 +7,6 @@ export default class ThroughHistoryService {
|
|
|
6
7
|
static undo(ctx: CanvasRenderingContext2D): void;
|
|
7
8
|
static redo(ctx: CanvasRenderingContext2D): void;
|
|
8
9
|
static clearCache(): void;
|
|
10
|
+
static recovery(project: Project): void;
|
|
9
11
|
private static updateCanvas;
|
|
10
12
|
}
|
|
@@ -37,6 +37,10 @@ class ThroughHistoryService {
|
|
|
37
37
|
static clearCache() {
|
|
38
38
|
ThroughHistoryService.cache = [];
|
|
39
39
|
}
|
|
40
|
+
static recovery(project) {
|
|
41
|
+
store_1.default.store.historyState.reduce('SET_HISTORY', { historyLines: project.state.history });
|
|
42
|
+
ThroughHistoryService.cache = project.state.cache;
|
|
43
|
+
}
|
|
40
44
|
static updateCanvas(ctx, stateValue) {
|
|
41
45
|
const filter = new filter_1.Filter(ctx);
|
|
42
46
|
filter.update(stateValue.tempImageData, stateValue.position);
|