Skip to content

Commit

Permalink
fix storybook rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
eyeseast committed May 16, 2024
1 parent c33d327 commit aeb6193
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/lib/components/documents/PDF.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
// worker is configured in +layout.svelte
import * as pdfjs from "pdfjs-dist/build/pdf.mjs";
if (!pdfjs.GlobalWorkerOptions.workerSrc) {
pdfjs.GlobalWorkerOptions.workerSrc = new URL(
"pdfjs-dist/build/pdf.worker.mjs",
import.meta.url,
).href;
}
import PdfPage from "./PDFPage.svelte";
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/documents/Page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
if (
boundingClientRect.top > rootBounds.top &&
boundingClientRect.top < rootBounds.height / 2
boundingClientRect.top < rootBounds.height / 2 &&
currentPage // in case context is missing
) {
$currentPage = page_number;
}
Expand Down

0 comments on commit aeb6193

Please sign in to comment.