Skip to content

Commit 1773563

Browse files
committed
🚸 优化拖入文字时的提示
1 parent bf275cb commit 1773563

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

app/src/core/service/controlService/controller/concrete/ControllerDragFile.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { TextRiseEffect } from "../../../feedbackService/effectEngine/concrete/T
1313
import { ViewFlashEffect } from "../../../feedbackService/effectEngine/concrete/ViewFlashEffect";
1414
import { ControllerClassDragFile } from "../ControllerClassDragFile";
1515
import { Dialog } from "../../../../../components/dialog";
16+
import { CircleChangeRadiusEffect } from "../../../feedbackService/effectEngine/concrete/CircleChangeRadiusEffect";
1617

1718
/**
1819
* BUG: 始终无法触发文件拖入事件
@@ -151,16 +152,8 @@ function readFileText(file: File): Promise<string> {
151152

152153
function dealTempFileDrop(mouseWorldLocation: Vector) {
153154
// 未知类型,按插入一个textNode判断
154-
const textNode = new TextNode({
155-
uuid: uuidv4(),
156-
text: "拖入文件为空",
157-
location: [mouseWorldLocation.x, mouseWorldLocation.y],
158-
size: [100, 100],
159-
color: [0, 0, 0, 0],
160-
details: "如果您想拖入文字直接来生成节点,建议先复制,然后直接在舞台上按ctrl+v",
161-
});
162-
textNode.move(new Vector(-textNode.rectangle.size.x / 2, -textNode.rectangle.size.y / 2));
163-
StageManager.addTextNode(textNode);
155+
Stage.effectMachine.addEffect(new TextRiseEffect("不能直接拖入文字"));
156+
Stage.effectMachine.addEffect(CircleChangeRadiusEffect.fromConnectPointShrink(mouseWorldLocation, 100));
164157
}
165158

166159
function dealUnknownFileDrop(file: File, mouseWorldLocation: Vector, i: number) {

0 commit comments

Comments
 (0)