-
Notifications
You must be signed in to change notification settings - Fork 70
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 max zoom limit #16
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey ;) thanks for your effort! The app is showing exactly the wanted behavior, that's cool! However, I have some change requests concerning the code:
- Instead of a separate ZoomUtils class, just inline the code like
case "-" -> zoomGoal = Math.max(0.1, zoomGoal / Math.pow(zoomStepFactor, 2));
(but with some MAX_ZOOM variable in Main.java) - Actually, it should probably be called "MIN_ZOOM", not "MAX_ZOOM", now that I think about it 😄
- Setting a maximum for the zoom should not be something that the
Coordinates
class is concerned about. Maybe you can rewrite the methodCoordinates.zoomInOnMouse
so that it takes the new zoom value instead of the zoom increase? Then, we can simply passMath.max(0.1, newZoom)
as argument when calling the method from theMain
class.
Hope you can work with my feedback, otherwise just let me know.
Hi! I'm happy the outcome of my work met your expectations in terms of functionality. I have made code changes according to your comment!
Hope everything will be better this time! 😃 |
Okay, that makes sense now... Thank you for the opportunity to participate in the project! 😀 |
ZoomUtils
static class with method to prevent from zooming out more than a 0.1 value with[-]
button.zoomInOnMouse
method ofCoordinates
class.Additionally, I thought about setting a
zoom
to 0.1 when next zoom out action would setzoom
to value smaller than 0.1.Any feedback desirabled!
Resolves #13