Skip to content

Commit

Permalink
fix: plugin-selection edge selection when moving, close #3084
Browse files Browse the repository at this point in the history
  • Loading branch information
yugasun committed Oct 8, 2023
1 parent 1c2d637 commit e0ca242
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/x6-example-features/src/pages/selection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default class Example extends React.Component {
multiple: true,
strict: true,
showNodeSelectionBox: true,
showEdgeSelectionBox: true,
selectCellOnMoved: false,
filter(cell) {
return cell !== a
Expand Down
5 changes: 5 additions & 0 deletions packages/x6-plugin-selection/src/selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export class SelectionImpl extends View<SelectionImpl.EventArgs> {

graph.on('scale', this.onGraphTransformed, this)
graph.on('translate', this.onGraphTransformed, this)
graph.on('node:moving', this.onNodeOrEdgeMove, this)
graph.model.on('updated', this.onModelUpdated, this)

collection.on('added', this.onCellAdded, this)
Expand Down Expand Up @@ -116,6 +117,10 @@ export class SelectionImpl extends View<SelectionImpl.EventArgs> {
this.updateSelectionBoxes()
}

protected onNodeOrEdgeMove() {
this.updateSelectionBoxes()
}

protected translating: boolean

protected onNodePositionChanged({
Expand Down

0 comments on commit e0ca242

Please sign in to comment.