Skip to content

Commit

Permalink
Ensure click_time is available to custom widgets (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
webfiltered authored Nov 26, 2024
1 parent ffa2a24 commit f6e885f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/LGraphCanvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3103,6 +3103,9 @@ export class LGraphCanvas {

this.adjustMouseEvent(e)

const now = LiteGraph.getTime()
e.click_time = now - this.last_mouseclick

/** The mouseup event occurred near the mousedown event. */
/** Normal-looking click event - mouseUp occurred near mouseDown, without dragging. */
const isClick = pointer.up(e)
Expand All @@ -3120,8 +3123,6 @@ export class LGraphCanvas {
return
}

const now = LiteGraph.getTime()
e.click_time = now - this.last_mouseclick
this.last_mouse_dragging = false
this.last_click_position = null

Expand Down

0 comments on commit f6e885f

Please sign in to comment.