Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add props to set custom min and max zoom levels #11

Merged
merged 2 commits into from
Aug 3, 2018

Conversation

MattyBalaam
Copy link
Contributor

@MattyBalaam MattyBalaam commented Aug 3, 2018

This pull request brings in customisable minimum and maximum scrollwheel zoom values.

src/index.js Outdated
@@ -164,7 +164,7 @@ class Cropper extends React.Component {
}

setNewZoom = zoom => {
const newZoom = Math.min(MAX_ZOOM, Math.max(zoom, MIN_ZOOM))
const newZoom = Math.min(this.props.minZoom, Math.max(zoom, this.props.maxZoom))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you switched min and max here ;)

Copy link
Contributor Author

@MattyBalaam MattyBalaam Aug 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry, will recommit. There’s something about Math min and max which always confuses me.

@ValentinH
Copy link
Owner

Nice, I was sure that somebody was going to contribute this 😆.

@ValentinH
Copy link
Owner

Thanks!

@ValentinH ValentinH merged commit 68ef7b9 into ValentinH:master Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants