1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-05 15:32:55 +02:00

* Fix moveTo for vertical writing mode.

This commit is contained in:
Meng-Yuan Huang 2020-09-05 21:37:23 +08:00
parent a1e77b745b
commit b7bb95d97a

View file

@ -343,6 +343,12 @@ class DefaultViewManager {
if (distX + this.layout.delta > this.container.scrollWidth) {
distX = this.container.scrollWidth - this.layout.delta;
}
distY = Math.floor(offset.top / this.layout.delta) * this.layout.delta;
if (distY + this.layout.delta > this.container.scrollHeight) {
distY = this.container.scrollHeight - this.layout.delta;
}
}
this.scrollTo(distX, distY, true);
}