diff --git a/app/src/core/stage/stageManager/concreteMethods/StageSectionInOutManager.tsx b/app/src/core/stage/stageManager/concreteMethods/StageSectionInOutManager.tsx index 3d3fcadb..10df8f65 100644 --- a/app/src/core/stage/stageManager/concreteMethods/StageSectionInOutManager.tsx +++ b/app/src/core/stage/stageManager/concreteMethods/StageSectionInOutManager.tsx @@ -90,6 +90,11 @@ export class SectionInOutManager { // 获取section的父级section const fatherSections = this.project.sectionMethods.getFatherSections(section); + // 先从父 section 的 children 中移除旧的 section 引用(直接操作数组,避免触发 sectionDropChild 的连锁反应) + for (const fatherSection of fatherSections) { + fatherSection.children = fatherSection.children.filter((child) => child.uuid !== section.uuid); + } + // 创建新的TextNode,保持UUID不变 const textNode = new TextNode(this.project, { uuid: section.uuid, // 保持UUID不变 diff --git a/app/src/core/stage/stageObject/entity/Section.tsx b/app/src/core/stage/stageObject/entity/Section.tsx index 64b554cd..9f944bdc 100644 --- a/app/src/core/stage/stageObject/entity/Section.tsx +++ b/app/src/core/stage/stageObject/entity/Section.tsx @@ -228,6 +228,10 @@ export class Section extends ConnectableEntity { } // 让内部元素也移动 for (const child of this.children) { + // 跳过已被选中的子元素,避免重复移动(解决速度叠加bug) + if (child.isSelected) { + continue; + } child.move(delta); }