合并画布代码
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//import { fabric } from "fabric-with-all";
|
||||
import { fabric } from "fabric-with-all";
|
||||
import { LayerType, OperationType, createBitmapLayer } from "./layerHelper";
|
||||
// 导入新的复合命令
|
||||
import { CreateImageLayerCommand } from "../commands/LayerCommands";
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
ChangeFixedImageCommand,
|
||||
AddImageToLayerCommand,
|
||||
} from "../commands/LayerCommands";
|
||||
import { generateId } from "./helper";
|
||||
|
||||
/**
|
||||
* 加载并处理图片
|
||||
@@ -44,6 +45,7 @@ export function loadImage(imageSource, options = {}) {
|
||||
// 设置图片位置 - 默认居中
|
||||
if (options.centerOnCanvas !== false) {
|
||||
fabricImage.set({
|
||||
id: generateId("fabricImage"),
|
||||
left: (options.canvasWidth || 800) / 2,
|
||||
top: (options.canvasHeight || 600) / 2,
|
||||
originX: "center",
|
||||
|
||||
Reference in New Issue
Block a user