Skip to content

Commit

Permalink
fix: trigger click event when click edge with vertices tool
Browse files Browse the repository at this point in the history
  • Loading branch information
NewByVector committed Sep 7, 2023
1 parent 0c2c1e1 commit e984c98
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/x6/src/registry/tool/vertices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export class Vertices extends ToolsView.ToolItem<EdgeView, Vertices.Options> {
edgeView.cell.startBatch('move-vertex', { ui: true, toolId: this.cid })
if (!this.options.stopPropagation) {
const { e: evt, x, y } = this.getMouseEventArgs(e)
this.eventData(evt, { start: { x, y } })
edgeView.notifyMouseDown(evt, x, y)
}
}
Expand Down Expand Up @@ -202,6 +203,13 @@ export class Vertices extends ToolsView.ToolItem<EdgeView, Vertices.Options> {

if (!this.options.stopPropagation) {
edgeView.notifyMouseUp(evt, x, y)
const { start } = this.eventData(evt)
if (start) {
const { x: startX, y: startY } = start
if (startX === x && startY === y) {
edgeView.onClick(evt as unknown as Dom.ClickEvent, x, y)
}
}
}

edgeView.checkMouseleave(evt)
Expand Down

0 comments on commit e984c98

Please sign in to comment.