[Documentation] Locator -> Location -> progression and totalProgression properties calculation #462
-
Hi, I want to understand how progression and totalProgression properties of Locator -> Location are calculated when a word/words selected within a publications chapter. In this documentation link I did not see anything about it. Since I want to make epub reader library migration of my app to readium, it is important to know the formula of those properties. I will make data transformation for pre-stored users data. Thanks in advance for any info. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
What do you mean exactly by "when a word/words selected within a publications chapter."?
|
Beta Was this translation helpful? Give feedback.
-
hi @mickael-menu thanks for reply. Let me explain the question in a little detail.
I thought that it also needs to define But as I understood from your reply, since we have
the rest could be ignored. Apart from all this, totalProgression is the scroll progression based on the entire book. And progression value is scroll progression based on a chapter. Please clarify me if everything were understood correctly. |
Beta Was this translation helpful? Give feedback.
That's right. When you use
navigator.currentSelection
, all the words on the visible page will have the sameprogression
: the scroll progression of the current page.As you can see below, we first take into account
text
, thenlocations.fragments
(for HTML IDs) and finally thelocations.progression
, when resolving aLocator
.swift-toolkit/Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift
Lines 270 to 278 in 06dbf83