Error resolved of zoom in. #1429
Open
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.
Key Features & Implementation
This PR updates the zoomIn() method in Mode1UpLit so that when the zoom level exceeds 2.0, the view automatically recenters on the current page, matching the behavior in jumpToIndex() for high zoom navigation. This improves the reading experience by preventing the page from drifting off-center when incrementally zooming in.
Changes
Updated zoomIn() to:
Detect when the new zoom level is greater than 2.0.
Call jumpToIndex() for the first visible page after zoom to re-center it.
Keeps existing throttled updates to rendered pages and visible region refresh.
Ensures behavior is consistent between high zoom page jumps and zoom button presses.
Reasoning
Previously, zooming in at high zoom levels would not adjust the scroll position, causing the target page to shift out of center view. This was inconsistent with the jumpToIndex() behavior and made fine zoom adjustments frustrating.
Testing
Opened a book in Mode1Up view.
Zoomed in past 2.0 scale using the zoom button.
Confirmed that the current page remains centered after each click.
Verified normal zoom (< 2.0) behavior is unaffected.
Impact
Improves usability for readers who prefer high magnification by keeping their focus point stable when zooming in.