-
Notifications
You must be signed in to change notification settings - Fork 388
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
Recalculate original state when resize() was called #188
Conversation
Might need to refactor the fix because most of the code in this fix was borrowed from We cannot reuse |
Thank you for the work. |
@@ -133,8 +136,7 @@ ShadowViewport.prototype.processCTM = function() { | |||
this.originalState.x = newCTM.e | |||
this.originalState.y = newCTM.f | |||
|
|||
// Update viewport CTM and cache zoom and pan | |||
this.setCTM(newCTM); |
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.
This line is only used by ShadowViewport.prototype.init()
. So i moved it out and place it after calling processCTM()
in init()
.
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.
This will allow reuse of processCTM()
in SvgPanZoom.prototype.resize()
@bumbu, I have refactored the code. You can test to see if it is ready for merge. This is a fix of behavior so could be a breaking change. |
Thanks @kevinlaw91 |
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.
Squashed everything and rebase to master
Thanks for your time. FYI this is just a simple bug fix for an odd behavior. I believe the old behavior wasn't suppose to be a feature, so it may not be a breaking change either. Anyway, feel free to test it out when you have time. Hope to see this get merged before next major release. ✌️ |
I tested it with different SVGs, also I paid attention to SVGs with Thanks for the effort! |
Proposed fix for #185