Skip to content

Commit

Permalink
fix: move initial image data storing to a reasonable place
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed Jun 21, 2020
1 parent 50547ba commit ed89b3e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## next

- Store the initial image data in the right place for avoiding [side-effect](https://github.com/fengyuanchen/jquery-cropper/issues/19).
- Fix the issue when the value of the `minContainerWidth/Height` options is `0` (#683).

## 1.5.7 (May 23, 2020)
Expand Down
1 change: 1 addition & 0 deletions src/js/cropper.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ class Cropper {
naturalHeight,
aspectRatio: naturalWidth / naturalHeight,
});
this.initialImageData = assign({}, this.imageData);
this.sizing = false;
this.sized = true;
this.build();
Expand Down
1 change: 0 additions & 1 deletion src/js/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ export default {
this.canvasData = canvasData;
this.limited = (viewMode === 1 || viewMode === 2);
this.limitCanvas(true, true);
this.initialImageData = assign({}, imageData);
this.initialCanvasData = assign({}, canvasData);
},

Expand Down

0 comments on commit ed89b3e

Please sign in to comment.