Skip to content

Commit

Permalink
reset zoom scale on image change
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-Lorenz committed Oct 24, 2024
1 parent c1a74ba commit 2f3cd2f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Editors/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ export abstract class Editor {
if (Editor.image.height === 0) {
throw new Error('image parsed with 0 height');
}

// on success reset global zoom and pan
Editor.zoomScale = 1;
Editor.offsetX = 0;
Editor.offsetY = 0;
}

public static pan(deltaX: number, deltaY: number): void {
Expand Down

0 comments on commit 2f3cd2f

Please sign in to comment.