From 47e5d5b8832f1c2b8aea8f7ae60e69cef31a94d6 Mon Sep 17 00:00:00 2001 From: MurakamiShinyu Date: Fri, 16 Feb 2024 00:24:36 +0900 Subject: [PATCH] fix: adjust TOC box width to account for scrollbar width --- packages/core/src/vivliostyle/epub.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/vivliostyle/epub.ts b/packages/core/src/vivliostyle/epub.ts index 3f00950fa..f9209661f 100644 --- a/packages/core/src/vivliostyle/epub.ts +++ b/packages/core/src/vivliostyle/epub.ts @@ -2635,7 +2635,7 @@ export class OPFView implements Vgen.CustomRendererFactory { ); } const viewport = this.viewport; - const tocWidth = Math.min(350, Math.round(0.67 * viewport.width) - 16); + const tocWidth = Math.min(344, Math.round(0.67 * viewport.width) - 16); const tocHeight = viewport.height - 6; const pageCont = viewport.document.createElement("div") as HTMLElement; viewport.root.appendChild(pageCont); @@ -2645,7 +2645,7 @@ export class OPFView implements Vgen.CustomRendererFactory { } // pageCont.style.left = "3px"; // pageCont.style.top = "3px"; - pageCont.style.width = `${tocWidth + 10}px`; + pageCont.style.width = `${tocWidth + 16}px`; pageCont.style.maxHeight = `${tocHeight}px`; // pageCont.style.overflow = "scroll"; // pageCont.style.overflowX = "hidden";