Merged
Conversation
Contributor
Author
|
I used the following code to save and restore the state. |
Contributor
|
Can you rebase this? |
35ec98d to
9433206
Compare
Contributor
Author
|
Done. Please review. |
Contributor
|
Thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First, revert back to old logic for layout change listener. old logic
It should fix #452 and #493.
Because when we are trying to set an initial scale by setScale, even if we are posting a runnable, onLayoutChange will be triggered after setScale. Inside onLayoutChange, updateBaseMatrix will reset the mSuppMatrix. Then setScale won't work for the initial setScale.
Second, add public methods getSuppMatrix and setSuppMatrix to save and restore scale and visible area, which should fix #509.
Third, sometimes the user can zoom the image larger than the max scale, which happens when we move the two fingers close first and then far away with a fling. We should make the image zoom back to the max scale.
Last, if we force the image to zoom back to max scale, with the above gesture, sometimes it causes the boundary issue. Please see the gif. So we should do checkMatrixBounds for the fling.
