@@ -5,6 +5,7 @@ import { RectanglePushInEffect } from "../../../service/feedbackService/effectEn
55import { Stage } from "../../Stage" ;
66import { ConnectableEntity } from "../../stageObject/abstract/ConnectableEntity" ;
77import { Entity } from "../../stageObject/abstract/StageEntity" ;
8+ import { PenStroke } from "../../stageObject/entity/PenStroke" ;
89import { GraphMethods } from "../basicMethods/GraphMethods" ;
910import { SectionMethods } from "../basicMethods/SectionMethods" ;
1011import { StageManager } from "../StageManager" ;
@@ -17,11 +18,11 @@ import { StageSectionInOutManager } from "./StageSectionInOutManager";
1718 * 以后还可能有自动布局的功能
1819 */
1920export namespace StageEntityMoveManager {
20- export function moveEntityUtils ( node : Entity , delta : Vector , isAutoAdjustSection : boolean = true ) {
21+ export function moveEntityUtils ( entity : Entity , delta : Vector , isAutoAdjustSection : boolean = true ) {
2122 // 让自己移动
22- node . move ( delta ) ;
23+ entity . move ( delta ) ;
2324
24- const nodeUUID = node . uuid ;
25+ const nodeUUID = entity . uuid ;
2526
2627 // if (StageManager.isSectionByUUID(nodeUUID)) {
2728 // // 如果是Section,则需要带动孩子一起移动
@@ -39,6 +40,15 @@ export namespace StageEntityMoveManager {
3940 }
4041 }
4142 }
43+ // 如果是涂鸦,则连带所有可连接对象一起移动
44+ if ( entity instanceof PenStroke ) {
45+ for ( const otherConnectableEntity of StageManager . getConnectableEntity ( ) ) {
46+ if ( entity . collisionBox . isIntersectsWithRectangle ( otherConnectableEntity . collisionBox . getRectangle ( ) ) ) {
47+ // 递归了
48+ moveEntityUtils ( otherConnectableEntity , delta , false ) ;
49+ }
50+ }
51+ }
4252 }
4353
4454 export function jumpMoveEntityUtils ( entity : Entity , delta : Vector ) {
0 commit comments