Skip to content

Commit

Permalink
Improvement: enable changing the aspect at runtime (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinH authored Jul 24, 2018
1 parent aaf3941 commit df30c2c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class Cropper extends React.Component {
componentDidUpdate(prevProps) {
if (prevProps.zoom !== this.props.zoom) {
this.recomputeCropPosition()
} else if (prevProps.aspect !== this.props.aspect) {
this.computeSizes()
}
}

Expand Down

0 comments on commit df30c2c

Please sign in to comment.