fix: drawing background size error #254
This commit is contained in:
@@ -1679,7 +1679,7 @@ export class Draw {
|
|||||||
ctx.globalAlpha = !this.zone.isMainActive() ? inactiveAlpha : 1
|
ctx.globalAlpha = !this.zone.isMainActive() ? inactiveAlpha : 1
|
||||||
this._clearPage(pageNo)
|
this._clearPage(pageNo)
|
||||||
// 绘制背景
|
// 绘制背景
|
||||||
this.background.render(ctx)
|
this.background.render(ctx, pageNo)
|
||||||
// 绘制页边距
|
// 绘制页边距
|
||||||
this.margin.render(ctx, pageNo)
|
this.margin.render(ctx, pageNo)
|
||||||
// 渲染元素
|
// 渲染元素
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ export class Background {
|
|||||||
this.draw = draw
|
this.draw = draw
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(ctx: CanvasRenderingContext2D) {
|
public render(ctx: CanvasRenderingContext2D, pageNo: number) {
|
||||||
const width = this.draw.getOriginalWidth()
|
const width = this.draw.getCanvasWidth(pageNo)
|
||||||
const height = this.draw.getOriginalHeight()
|
const height = this.draw.getCanvasHeight(pageNo)
|
||||||
ctx.save()
|
ctx.save()
|
||||||
ctx.fillStyle = '#ffffff'
|
ctx.fillStyle = '#ffffff'
|
||||||
ctx.fillRect(0, 0, width, height)
|
ctx.fillRect(0, 0, width, height)
|
||||||
|
|||||||
Reference in New Issue
Block a user