Skip to content

Commit

Permalink
Improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed Mar 19, 2017
1 parent 93dc2ca commit 4d279a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/js/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ export default {
}

const ratio = container.offsetWidth / containerData.width;
let canvasData;
let cropBoxData;

// Resize when width changed or height changed
if (ratio !== 1 || container.offsetHeight !== containerData.height) {
let canvasData;
let cropBoxData;

if (options.restore) {
canvasData = self.getCanvasData();
cropBoxData = self.getCropBoxData();
Expand Down

0 comments on commit 4d279a3

Please sign in to comment.