Skip to content

Commit c60abab

Browse files
committed
🐛 图片节点可以在舞台上复制了
1 parent 9b704d3 commit c60abab

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/src/core/stage/stageManager/concreteMethods/StageSerializedAdder.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { PenStroke } from "../../stageObject/entity/PenStroke";
1111
import { UrlNode } from "../../stageObject/entity/UrlNode";
1212
import { Entity } from "../../stageObject/abstract/StageEntity";
1313
import { CublicCatmullRomSplineEdge } from "../../stageObject/association/CublicCatmullRomSplineEdge";
14+
import { ImageNode } from "../../stageObject/entity/ImageNode";
1415
/**
1516
* 直接向舞台中添加序列化数据
1617
* 用于向舞台中附加新文件图、或者用于复制粘贴、甚至撤销
@@ -38,6 +39,8 @@ export namespace StageSerializedAdder {
3839
entityObject = new PortalNode(entity);
3940
} else if (Serialized.isUrlNode(entity)) {
4041
entityObject = new UrlNode(entity);
42+
} else if (Serialized.isImageNode(entity)) {
43+
entityObject = new ImageNode(entity);
4144
}
4245
if (entityObject) {
4346
entityObject.moveTo(entityObject.collisionBox.getRectangle().location.add(diffLocation));
@@ -48,7 +51,6 @@ export namespace StageSerializedAdder {
4851
if (Serialized.isLineEdge(edge)) {
4952
StageManager.addLineEdge(new LineEdge(edge));
5053
} else if (Serialized.isCublicCatmullRomSplineEdge(edge)) {
51-
// TODO:
5254
StageManager.addCrEdge(new CublicCatmullRomSplineEdge(edge));
5355
}
5456
}

0 commit comments

Comments
 (0)