合并画布代码
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Command } from "./Command";
|
||||
//import { fabric } from "fabric-with-all";
|
||||
import { fabric } from "fabric-with-all";
|
||||
|
||||
/**
|
||||
* 创建背景图层命令
|
||||
@@ -195,10 +195,13 @@ export class BackgroundSizeCommand extends Command {
|
||||
this.newWidth = options.newWidth;
|
||||
this.newHeight = options.newHeight;
|
||||
this.historyManager = options.historyManager;
|
||||
this.isRedGreenMode = options.isRedGreenMode;
|
||||
|
||||
this.bgLayer = this.layers.value.find((layer) => layer.isBackground);
|
||||
|
||||
// 记录原尺寸
|
||||
this.oldWidth = this.canvas.width;
|
||||
this.oldHeight = this.canvas.height;
|
||||
this.oldWidth = this.bgLayer.fabricObject.width;
|
||||
this.oldHeight = this.bgLayer.fabricObject.height;
|
||||
|
||||
// 查找背景图层
|
||||
this.bgLayer = this.layers.value.find((layer) => layer.isBackground);
|
||||
|
||||
Reference in New Issue
Block a user