Skip to content

Commit

Permalink
Fix problem that page background color is not painted in the bleed area
Browse files Browse the repository at this point in the history
Note: this fix is not very perfect and has limitation
- not fixed about background images
- when the background color has alpha value of rgba(), the page box (the area bleed box minus bleed area) background color becomes darker because both bleed box and page box have the same background color and it increases the opacity.
  • Loading branch information
MurakamiShinyu committed Mar 21, 2019
1 parent d329ff0 commit 0fcba15
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/vivliostyle/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,13 @@ vivliostyle.page.addPrinterMarks = (cascadedPageStyle, evaluatedPageSizeAndBleed
const printerMarkOffset = adapt.css.toNumber(vivliostyle.page.defaultPrinterMarkOffset, context);
const lineLength = adapt.css.toNumber(vivliostyle.page.defaultPrinterMarkLineLength, context);

if (bleed) {
const bgcolor = cascadedPageStyle["background-color"];
if (bgcolor && bgcolor.value) {
page.bleedBox.style.backgroundColor = bgcolor.value.stringValue()
}
}

// corner marks
if (crop) {
Object.keys(vivliostyle.page.CornerMarkPosition).forEach(key => {
Expand Down

0 comments on commit 0fcba15

Please sign in to comment.