@@ -1013,16 +1013,24 @@ class GraphModel {
1013
1013
const edgeModel = this . edges [ i ] ;
1014
1014
const { x, y } = edgeModel . textPosition ;
1015
1015
const sourceMoveDistance = nodeIdMap [ edgeModel . sourceNodeId ] ;
1016
+ const targetMoveDistance = nodeIdMap [ edgeModel . targetNodeId ] ;
1016
1017
let textDistanceX ;
1017
1018
let textDistanceY ;
1018
- if ( sourceMoveDistance ) {
1019
+ if ( sourceMoveDistance
1020
+ && targetMoveDistance
1021
+ && edgeModel . modelType === ModelType . POLYLINE_EDGE ) {
1022
+ // 移动框选区时,如果边polyline在框选范围内,则边的轨迹pointsList也要整体移动
1019
1023
[ textDistanceX , textDistanceY ] = sourceMoveDistance ;
1020
- edgeModel . moveStartPoint ( textDistanceX , textDistanceY ) ;
1021
- }
1022
- const targetMoveDistance = nodeIdMap [ edgeModel . targetNodeId ] ;
1023
- if ( targetMoveDistance ) {
1024
- [ textDistanceX , textDistanceY ] = targetMoveDistance ;
1025
- edgeModel . moveEndPoint ( textDistanceX , textDistanceY ) ;
1024
+ edgeModel . updatePointsList ( textDistanceX , textDistanceY ) ;
1025
+ } else {
1026
+ if ( sourceMoveDistance ) {
1027
+ [ textDistanceX , textDistanceY ] = sourceMoveDistance ;
1028
+ edgeModel . moveStartPoint ( textDistanceX , textDistanceY ) ;
1029
+ }
1030
+ if ( targetMoveDistance ) {
1031
+ [ textDistanceX , textDistanceY ] = targetMoveDistance ;
1032
+ edgeModel . moveEndPoint ( textDistanceX , textDistanceY ) ;
1033
+ }
1026
1034
}
1027
1035
if ( sourceMoveDistance || targetMoveDistance ) {
1028
1036
// https://github.com/didi/LogicFlow/issues/1191
0 commit comments