Skip to content

Commit

Permalink
fix: recompute size when objectFit is changed (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinH committed Sep 6, 2023
1 parent 446fdd2 commit ff22d80
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Cropper.tsx
Expand Up @@ -191,6 +191,8 @@ class Cropper extends React.Component<CropperProps, State> {
this.recomputeCropPosition()
} else if (prevProps.aspect !== this.props.aspect) {
this.computeSizes()
} else if (prevProps.objectFit !== this.props.objectFit) {
this.computeSizes()
} else if (prevProps.zoom !== this.props.zoom) {
this.recomputeCropPosition()
} else if (
Expand Down

0 comments on commit ff22d80

Please sign in to comment.