Skip to content

Commit

Permalink
fix: images with width and height specified may dissapear in print
Browse files Browse the repository at this point in the history
- fix #1321
  • Loading branch information
MurakamiShinyu committed Jun 3, 2024
1 parent 4eae55e commit 1c5675e
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions packages/core/src/vivliostyle/epub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1834,14 +1834,38 @@ export class OPFView implements Vgen.CustomRendererFactory {
}

renderAllPages(): Task.Result<PageAndPosition | null> {
return this.renderPagesUpto(
const frame: Task.Frame<PageAndPosition | null> =
Task.newFrame("renderAllPages");
this.renderPagesUpto(
{
spineIndex: this.opf.spine.length - 1,
pageIndex: Number.POSITIVE_INFINITY,
offsetInItem: -1,
},
false,
);
).then((result) => {
// Wait until all images are loaded (Issue #1321)
frame
.loopWithFrame((loopFrame) => {
if (
this.spineItems.some((viewItem) =>
viewItem.pages.some((page) =>
page.fetchers.some((fetcher) => !fetcher.arrived),
),
)
) {
frame.sleep(20).then(() => {
loopFrame.continueLoop();
});
} else {
loopFrame.breakLoop();
}
})
.then(() => {
frame.finish(result);
});
});
return frame.result();
}

/**
Expand Down

0 comments on commit 1c5675e

Please sign in to comment.