Skip to content

Commit

Permalink
Update zoom limit when dynamically resizing viewport
Browse files Browse the repository at this point in the history
  • Loading branch information
theodorejb committed Dec 13, 2024
1 parent 34b1ad6 commit 7b27692
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cropt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,14 @@ export class Cropt {
options.viewport = { ...this.options.viewport, ...options.viewport };
}

this.options = { ...this.options, ...(options as CroptOptions) };
this.options = structuredClone({ ...this.options, ...(options as CroptOptions) });
this.#setOptionsCss();

if (
this.options.viewport.width !== curWidth ||
this.options.viewport.height !== curHeight
) {
this.refresh();
this.#updateZoomLimits();
}
}

Expand Down

0 comments on commit 7b27692

Please sign in to comment.