diff --git a/src/BookReader/Mode1UpLit.js b/src/BookReader/Mode1UpLit.js index f22c02300..f75911354 100644 --- a/src/BookReader/Mode1UpLit.js +++ b/src/BookReader/Mode1UpLit.js @@ -51,9 +51,6 @@ export class Mode1UpLit extends LitElement { @property({ type: Object }) scaleCenter = { x: 0.5, y: 0.5 }; - // Needed for ModeSmoothZoom - worldOffset = { x: 0, y: 0 }; - /************** VIRTUAL-SCROLLING PROPERTIES **************/ /** in world coordinates (inches) */ diff --git a/src/BookReader/Mode2UpLit.js b/src/BookReader/Mode2UpLit.js index e79b3de5c..936edf186 100644 --- a/src/BookReader/Mode2UpLit.js +++ b/src/BookReader/Mode2UpLit.js @@ -49,8 +49,6 @@ export class Mode2UpLit extends LitElement { @property({ type: String }) autoFit = 'auto'; - worldOffset = { x: 0, y: 0 }; - /************** VIRTUAL-FLIPPING PROPERTIES **************/ /** ms for flip animation */ @@ -418,8 +416,8 @@ export class Mode2UpLit extends LitElement { } recenter(page = this.visiblePages[0]) { - this.worldOffset = this.computeTranslate(page, this.scale); - this.$book.style.transform = `translateX(${this.worldOffset.x}px) translateY(${this.worldOffset.y}px) scale(${this.scale})`; + const translate = this.computeTranslate(page, this.scale); + this.$book.style.transform = `translateX(${translate.x}px) translateY(${translate.y}px) scale(${this.scale})`; } /** diff --git a/src/BookReader/ModeSmoothZoom.js b/src/BookReader/ModeSmoothZoom.js index e2b649025..9b38f13c2 100644 --- a/src/BookReader/ModeSmoothZoom.js +++ b/src/BookReader/ModeSmoothZoom.js @@ -9,7 +9,6 @@ import Hammer from "hammerjs"; * @property {import("./options.js").AutoFitValues} autoFit * @property {number} scale * @property {{ x: number, y: number }} scaleCenter - * @property {{ x: number, y: number }} worldOffset * @property {HTMLDimensionsCacher} htmlDimensionsCacher * @property {function(): void} [attachScrollListeners] * @property {function(): void} [detachScrollListeners] @@ -206,7 +205,7 @@ export class ModeSmoothZoom { y: F * oldCenter.y, }; - container.scrollTop = newCenter.y - YPOS * H - this.mode.worldOffset.y; - container.scrollLeft = newCenter.x - XPOS * W - this.mode.worldOffset.x; + container.scrollTop = newCenter.y - YPOS * H; + container.scrollLeft = newCenter.x - XPOS * W; } } diff --git a/tests/jest/BookReader/ModeSmoothZoom.test.js b/tests/jest/BookReader/ModeSmoothZoom.test.js index 65e32a319..e983025ea 100644 --- a/tests/jest/BookReader/ModeSmoothZoom.test.js +++ b/tests/jest/BookReader/ModeSmoothZoom.test.js @@ -18,7 +18,6 @@ function dummy_mode(overrides = {}) { boundingClientRect: { left: 0, top: 0 }, }, scaleCenter: {x: 0.5, y: 0.5}, - worldOffset: {x: 0, y: 0}, ...overrides }; }