-
Notifications
You must be signed in to change notification settings - Fork 14
Conversation
@@ -81,9 +81,9 @@ class SvgPreviewView extends View { | |||
this.controls.find('a').on('click', (e) => { | |||
this.changeBackground($(e.target).attr('value')) | |||
}) | |||
this.zoomOutButton.on('click', (e) => this.zoom(-0.1)) | |||
this.zoomOutButton.on('click', (e) => this.zoom(9 / 10 - 1)) |
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.
9 / 10 - 1
= -0.1
, what's the point of this?
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.
The value of the formular is the same. I only updated it to match the zoom-in formular.
this.resetZoomButton.on('click', (e) => this.zoomReset()) | ||
this.zoomInButton.on('click', (e) => this.zoom(0.1)) | ||
this.zoomInButton.on('click', (e) => this.zoom(10 / 9 - 1)) |
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.
10 / 9 - 1
= `0.11...´, why would that be better?
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.
As describe above of you use the argument 0.1
and -0.1
the scaling factor is not symmetric. Clicking each zoom button (in and out) once does not get you back to the original zoom factor.
With the updated argument for zoom-in (0.111... instead of 0.1) the two scaling factors are exact inverse operations. So after clicking both you are exactly back to where you started.
I have commented on the questions. Is there anything else preventing this from being merged? |
Thank you! |
Thank you for merging this. Are you planning on other changes in the near term or could this change be released? |
@josa42 Any chance to get this fix released to make it available to users? |
@dirk-thomas I'll release it when the I have figured out, why the test are failing. But I do nor have much time to spare currently. |
@josa42 I noticed that you recently got master to pass CI again. Any reason not to release a new version? |
When clicking zoom-in once and then zoom-out once you are currently not back at the original scale. E.g. from 100% you get to 90% and then back to 99% whereas the user expects to be back to where he started.
This patch modifies the arguments to the zoom function to actually be symmetric.