Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! fixup! fixup! fixup! Update PDF.js v4.7.76
Browse files Browse the repository at this point in the history
  • Loading branch information
tamuratak committed Oct 7, 2024
1 parent ff5872f commit b69cc46
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions viewer/components/pagetrimmer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,17 @@ export enum TrimMode {
TRIM_15 = 3,
}

const trimRule05 = { trimValue: 0.05, sheet: document.createElement('style') } as const
const trimRule10 = { trimValue: 0.10, sheet: document.createElement('style') } as const
const trimRule15 = { trimValue: 0.15, sheet: document.createElement('style') } as const
const trimRule05 = { trimValue: 0.05, sheet: new CSSStyleSheet() } as const
const trimRule10 = { trimValue: 0.10, sheet: new CSSStyleSheet() } as const
const trimRule15 = { trimValue: 0.15, sheet: new CSSStyleSheet() } as const
const trimValueAndSheet = [trimRule05, trimRule10, trimRule15] as const
trimValueAndSheet.forEach(({ trimValue, sheet }) => {
document.head.appendChild(sheet)
const left = -100 * trimValue
sheet.textContent = `
.page canvas {
left: ${left}%;
position: relative;
}
.page .textLayer {
left: ${left}%;
}
.page .annotationLayer {
left: ${left}%;
}
`
sheet.insertRule(`.page canvas { left: ${left}%; position: relative; }`)
sheet.insertRule(`.page .textLayer { left: ${left}%; }`)
sheet.insertRule(`.page .annotationLayer { left: ${left}%; }`)
sheet.disabled = true
document.adoptedStyleSheets.push(sheet)
})

function disableAllTrimRuleStylesheets() {
Expand Down

0 comments on commit b69cc46

Please sign in to comment.