You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling display(cfi), DefaultViewManger.display -> DefaultViewManager.moveTo is executed and offset is adjusted.
Looking at DefaultViewerManager.next, it executes scrollBy for this.layout.delta in the x direction when ltr and this.layout.height in the y direction when rtl and vertical.
Conditions
examples/locations.html
.Problem
Offset is shifted when calling
display(cfi)
.Possible Causes
display(cfi)
,DefaultViewManger.display
->DefaultViewManager.moveTo
is executed and offset is adjusted.DefaultViewerManager.next
, it executesscrollBy
forthis.layout.delta
in the x direction whenltr
andthis.layout.height
in the y direction whenrtl
andvertical
.epub.js/src/managers/default/index.js
Line 466 in 0963efe
epub.js/src/managers/default/index.js
Line 499 in 0963efe
moveTo
, ifrtl
andvertical
, it executesscrollTo
fordistY = Math.floor(offset.top / this. layout.delta) * this.layout.delta;
epub.js/src/managers/default/index.js
Line 353 in 0963efe
this.layout.height
and is considered to be shifted.countermeasure
I believe we need to change
this.layout.delta
indistY = Math.floor(offset.top / this.layout.delta) * this.layout.delta;
tothis.layout.height
.epub.js/src/managers/default/index.js
Lines 353 to 356 in 0963efe
Results of measures
horizontal
epub,offset.top
<this.layout.delta
always holds anddistY=0
, with no effect.If this change is considered reasonable I would like to submit a PR. Thank you!
The text was updated successfully, but these errors were encountered: