Skip to content

Commit

Permalink
fix: 修复 2.0 版本 ANCHOR_DRAGED 在没有创建连线的情况下不会触发的 bug
Browse files Browse the repository at this point in the history
close #1928
  • Loading branch information
boyongjiong committed Oct 30, 2024
1 parent 88e7a54 commit fc9361f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/event/eventArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ type AnchorEventArgsPick<T extends 'data' | 'e' | 'nodeModel' | 'edgeModel'> =
/**
* 通过拖动锚点连线添加的边的数据
*/
edgeModel: BaseEdgeModel
edgeModel?: BaseEdgeModel
},
T
>
Expand Down
15 changes: 7 additions & 8 deletions packages/core/src/view/Anchor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,13 @@ class Anchor extends Component<IProps, IState> {
this.sourceRuleResults.clear()
this.targetRuleResults.clear()
const { graphModel, nodeModel, anchorData } = this.props
if (edgeModel) {
graphModel.eventCenter.emit(EventType.ANCHOR_DRAGEND, {
data: anchorData,
e: event!,
nodeModel,
edgeModel,
})
}

graphModel.eventCenter.emit(EventType.ANCHOR_DRAGEND, {
data: anchorData,
e: event!,
nodeModel,
edgeModel: edgeModel ?? undefined,
})
}

get customTrajectory() {
Expand Down

0 comments on commit fc9361f

Please sign in to comment.