Media editing improvements

This commit is contained in:
Josh Perez 2021-12-02 11:55:07 -05:00 committed by GitHub
parent 4701aeb79e
commit 5cca047910
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 208 additions and 52 deletions

View file

@ -43,7 +43,7 @@ const LIMIT = 1000;
type SnapshotStateType = {
canvasState: string;
imageState?: ImageStateType;
imageState: ImageStateType;
};
export class FabricHistory extends EventEmitter {
@ -83,7 +83,7 @@ export class FabricHistory extends EventEmitter {
return;
}
this.takeSnapshot();
this.emit('pleaseTakeSnapshot');
}
private getUndoState(): SnapshotStateType | undefined {
@ -103,7 +103,7 @@ export class FabricHistory extends EventEmitter {
return this.snapshots[this.highWatermark];
}
public takeSnapshot(imageState?: ImageStateType): void {
public takeSnapshot(imageState: ImageStateType): void {
if (this.isTimeTraveling) {
return;
}