From 0fe4358234522adea341b8c70c686d1372f6fe83 Mon Sep 17 00:00:00 2001 From: Valentin Hervieu Date: Tue, 24 Jul 2018 15:11:32 +0200 Subject: [PATCH] Improvement: enable changing the aspect at runtime --- src/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.js b/src/index.js index f96e286..68015bd 100644 --- a/src/index.js +++ b/src/index.js @@ -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() } }