From f076f2bd00eae6f3adf56559e40807898a8de229 Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Wed, 15 Mar 2023 20:05:00 +0800 Subject: [PATCH] feat:adjust background when paper direction change --- src/editor/core/draw/frame/Background.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/editor/core/draw/frame/Background.ts b/src/editor/core/draw/frame/Background.ts index d8a761f..d5873af 100644 --- a/src/editor/core/draw/frame/Background.ts +++ b/src/editor/core/draw/frame/Background.ts @@ -1,16 +1,16 @@ -import { IEditorOption } from '../../../interface/Editor' import { Draw } from '../Draw' export class Background { - private options: Required + private draw: Draw constructor(draw: Draw) { - this.options = draw.getOptions() + this.draw = draw } public render(ctx: CanvasRenderingContext2D) { - const { width, height } = this.options + const width = this.draw.getOriginalWidth() + const height = this.draw.getOriginalHeight() ctx.save() ctx.fillStyle = '#ffffff' ctx.fillRect(0, 0, width, height)