Fix keyboard 0 not resetting zoom in fixed-layout books

When pressing 0 to reset zoom, the code was calling
removeAttribute('zoom') on the renderer, which removed the DOM
attribute but left the internal zoom/transform state stale. This meant
subsequent zoom operations would compound on the old hidden state.

Replace with the new resetZoom() method that properly clears the
numeric zoom and triggers a clean re-render.
This commit is contained in:
2026-04-18 22:34:10 -04:00
parent 7ec14df593
commit 285b6711da
+2 -2
View File
@@ -209,7 +209,7 @@ class Reader {
renderer instanceof FixedLayout,
);
if (renderer instanceof FixedLayout) {
renderer.removeAttribute("zoom");
renderer.resetZoom();
renderer.dragOffset = { x: 0, y: 0 };
$("#zoom-reset").textContent = "100%";
console.log("[Reader Debug] ✅ Zoom reset");
@@ -346,7 +346,7 @@ class Reader {
console.log("[Reader Debug] 🔄 Reset zoom via keyboard");
const renderer = this.view.renderer;
if (renderer instanceof FixedLayout) {
renderer.removeAttribute("zoom");
renderer.resetZoom();
renderer.dragOffset = { x: 0, y: 0 };
$("#zoom-reset").textContent = "100%";
console.log("[Reader Debug] ✅ Keyboard zoom reset");