-
Notifications
You must be signed in to change notification settings - Fork 200
Add the scroll progressions in the EPUB viewport#620
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.
Pull Request Overview
This PR updates how scroll progression ranges are handled in the EPUB viewport and fixes viewport positions for FXL EPUBs. Key changes include updating progression methods to return ClosedRange rather than Range, modifying associated variable types and computations in EPUBReflowableSpreadView.swift, and enhancing EPUBNavigatorViewController.swift by mapping progression values for visible reading order resources.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Sources/Navigator/EPUB/EPUBSpreadView.swift | Changed progression() to return a ClosedRange with a default value of 0 ... 1 |
| Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift | Updated progression variable types and adjusted progression computation using ClosedRange |
| Sources/Navigator/EPUB/EPUBNavigatorViewController.swift | Added a progressions property using a reduce on readingOrderIndices and updated locator calculations |
Comments suppressed due to low confidence (3)
Sources/Navigator/EPUB/EPUBSpreadView.swift:347
- The default progression value has been changed from an empty range (0 ..< 0) to a full range (0 ... 1). Update the documentation for progression(in:) to clarify that this default is used when a resource does not override the method.
0 ... 1
Sources/Navigator/EPUB/EPUBNavigatorViewController.swift:647
- [nitpick] The variable 'link' is re-declared in this diff. Consider renaming it (e.g., 'firstLink') to avoid potential confusion with any earlier usage of a similar variable name.
let link = readingOrder[firstIndex]
Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift:343
- [nitpick] Verify that the use of a ClosedRange for progression correctly represents the intended behavior, ensuring that firstProgression and lastProgression are always in the correct order to prevent unintentional overlapping or inversion of the progression range.
progression = firstProgression ... lastProgression