fix: fix move event trigger error (#643)

This commit is contained in:
vector
2021-02-02 21:50:47 +08:00
committed by GitHub
parent 213a01fca2
commit 6bbed083ce

View File

@ -1057,14 +1057,16 @@ export class NodeView<
y: number,
cell: Cell,
) {
const cells = [cell]
let cells = [cell]
const selection = this.graph.selection.widget
if (selection && selection.options.movable) {
const selectedCells = this.graph.getSelectedCells()
cells.push(
...selectedCells.filter((c: Cell) => c.isNode() && c.id !== cell.id),
)
if (selectedCells.includes(cell)) {
cells = selectedCells.filter((c: Cell) => c.isNode())
}
}
cells.forEach((c: Cell) => {
this.notify(name, {
e,