Skip to content

Commit

Permalink
Add a reset button
Browse files Browse the repository at this point in the history
  • Loading branch information
sondreb committed Nov 16, 2024
1 parent 8fe2fc9 commit 27af7c0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app/photo-collage/photo-collage.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
<div class="controls">
<button (click)="fileInput.click()">Add Photos</button>
<button (click)="saveCollage()">Save Collage</button>
<button (click)="resetCollage()">Reset</button>
</div>
</div>
10 changes: 10 additions & 0 deletions src/app/photo-collage/photo-collage.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,4 +526,14 @@ export class PhotoCollageComponent implements AfterViewInit {

this.render();
}

resetCollage() {
this.photos = [];
this.maxZIndex = 0;
this.scale = 1;
this.panX = 0;
this.panY = 0;
this.hoveredPhoto = null;
this.render();
}
}

0 comments on commit 27af7c0

Please sign in to comment.