fix: 修复多个已知问题

This commit is contained in:
bighuixiang
2025-06-29 23:29:47 +08:00
parent 6fc2a8fc57
commit 4a95f27966
41 changed files with 2266 additions and 351 deletions

View File

@@ -28,6 +28,7 @@ import {
simplifyLayers,
validateLayerAssociations,
} from "../utils/layerUtils";
import { imageModeHandler } from "../utils/imageHelper";
export class CanvasManager {
constructor(canvasElement, options) {
@@ -107,6 +108,23 @@ export class CanvasManager {
id: fabricImage.id || generateId("brush_img_"),
});
if (options.imageMode) {
imageModeHandler({
imageMode: options.imageMode,
newImage: fabricImage,
canvasWidth: this.canvasWidth.value,
canvasHeight: this.canvasHeight.value,
});
// 默认居中
fabricImage.set({
originX: "center",
originY: "center",
left: this.canvas.width / 2,
top: this.canvas.height / 2,
});
}
// 执行高保真合并操作
await this.eventManager?.mergeLayerObjectsForPerformance?.({
fabricImage,