From f6e885f015bd789e678130ffa0085f307320faab Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Wed, 27 Nov 2024 05:05:47 +1100 Subject: [PATCH] Ensure click_time is available to custom widgets (#349) --- src/LGraphCanvas.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/LGraphCanvas.ts b/src/LGraphCanvas.ts index b5d57a344..a693c1f75 100644 --- a/src/LGraphCanvas.ts +++ b/src/LGraphCanvas.ts @@ -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) @@ -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