Skip to content

Commit

Permalink
fix: adjust TOC box width to account for scrollbar width
Browse files Browse the repository at this point in the history
  • Loading branch information
MurakamiShinyu committed Feb 15, 2024
1 parent 8e70fb1 commit 47e5d5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/vivliostyle/epub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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";
Expand Down

0 comments on commit 47e5d5b

Please sign in to comment.