Skip to content

Commit

Permalink
added resize for cycling images
Browse files Browse the repository at this point in the history
  • Loading branch information
JediWattson committed Jul 20, 2022
1 parent 70d5d29 commit 69d6a97
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/ImageView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ class ImageView extends PureComponent {
if (this.canUseTouchScreen) {
return;
}
document.addEventListener('mousemove', this.trackMovement.bind(this));
}

componentDidUpdate() {
// resize the image when cycled through
Image.getSize(this.props.url, (width, height) => {
this.setImageRegion(width, height);
});
document.addEventListener('mousemove', this.trackMovement.bind(this));
}

componentWillUnmount() {
Expand Down

0 comments on commit 69d6a97

Please sign in to comment.