fix: 修复多个已知问题
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user