Skip to content

Commit

Permalink
feat: make undo, clear return paths
Browse files Browse the repository at this point in the history
  • Loading branch information
QuadFlask committed Mar 4, 2021
1 parent 77e4408 commit 4685103
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/core/src/drawing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,17 @@ export class SvgDrawing extends Renderer {
this.on()
}

public clear(): void {
public clear(): Path[] {
const paths = this.paths
this.paths = []
this.update()
return paths
}

public undo(): void {
this.paths.pop()
public undo(): Path | undefined {
const path = this.paths.pop()
this.update()
return path
}

public changeDelay(delay: number): void {
Expand Down

0 comments on commit 4685103

Please sign in to comment.