|
|
|
@ -99,14 +99,19 @@ export class Background {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public render(ctx: CanvasRenderingContext2D, pageNo: number) {
|
|
|
|
public render(ctx: CanvasRenderingContext2D, pageNo: number) {
|
|
|
|
const { background } = this.options
|
|
|
|
const {
|
|
|
|
if (background.image) {
|
|
|
|
background: { image, color, applyPageNumbers }
|
|
|
|
|
|
|
|
} = this.options
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
|
|
|
image &&
|
|
|
|
|
|
|
|
(!applyPageNumbers?.length || applyPageNumbers.includes(pageNo))
|
|
|
|
|
|
|
|
) {
|
|
|
|
const { width, height } = this.options
|
|
|
|
const { width, height } = this.options
|
|
|
|
this._renderBackgroundImage(ctx, width, height)
|
|
|
|
this._renderBackgroundImage(ctx, width, height)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
const width = this.draw.getCanvasWidth(pageNo)
|
|
|
|
const width = this.draw.getCanvasWidth(pageNo)
|
|
|
|
const height = this.draw.getCanvasHeight(pageNo)
|
|
|
|
const height = this.draw.getCanvasHeight(pageNo)
|
|
|
|
this._renderBackgroundColor(ctx, background.color, width, height)
|
|
|
|
this._renderBackgroundColor(ctx, color, width, height)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|