From 56f7a429920e1a4efca9498271648db233f7cde3 Mon Sep 17 00:00:00 2001 From: Shahar Marcus <88977041+ShaharMS@users.noreply.github.com> Date: Sat, 1 Oct 2022 12:57:00 +0300 Subject: [PATCH] fix an oversight when setting clickCount for some reason I'm assigning clickCount after dispatching the event. that means we're always one click behind. --- src/lime/_internal/backend/native/NativeApplication.hx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lime/_internal/backend/native/NativeApplication.hx b/src/lime/_internal/backend/native/NativeApplication.hx index d86933158..afbb406f1 100644 --- a/src/lime/_internal/backend/native/NativeApplication.hx +++ b/src/lime/_internal/backend/native/NativeApplication.hx @@ -335,12 +335,13 @@ class NativeApplication switch (mouseEventInfo.type) { case MOUSE_DOWN: - window.onMouseDown.dispatch(mouseEventInfo.x, mouseEventInfo.y, mouseEventInfo.button); window.clickCount = mouseEventInfo.clickCount; + window.onMouseDown.dispatch(mouseEventInfo.x, mouseEventInfo.y, mouseEventInfo.button); case MOUSE_UP: - window.onMouseUp.dispatch(mouseEventInfo.x, mouseEventInfo.y, mouseEventInfo.button); window.clickCount = mouseEventInfo.clickCount; + window.onMouseUp.dispatch(mouseEventInfo.x, mouseEventInfo.y, mouseEventInfo.button); + case MOUSE_MOVE: window.onMouseMove.dispatch(mouseEventInfo.x, mouseEventInfo.y);