From 1e45cbea7a60cf7492003d0c1e08e4f8791f5322 Mon Sep 17 00:00:00 2001 From: Shahar Marcus <88977041+ShaharMS@users.noreply.github.com> Date: Tue, 13 Sep 2022 20:16:55 +0300 Subject: [PATCH] another attempt to fix the signature error --- project/include/ui/MouseEvent.h | 2 +- project/src/ui/MouseEvent.cpp | 3 ++- src/lime/_internal/backend/html5/HTML5Window.hx | 4 ++-- src/lime/_internal/backend/native/NativeApplication.hx | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/project/include/ui/MouseEvent.h b/project/include/ui/MouseEvent.h index 8c8cbea4e..c3f86aa9a 100644 --- a/project/include/ui/MouseEvent.h +++ b/project/include/ui/MouseEvent.h @@ -24,13 +24,13 @@ namespace lime { hl_type* t; int button; - int clickCount; double movementX; double movementY; MouseEventType type; int windowID; double x; double y; + int clickCount; static ValuePointer* callback; static ValuePointer* eventObject; diff --git a/project/src/ui/MouseEvent.cpp b/project/src/ui/MouseEvent.cpp index e28100d61..6de34ca6a 100644 --- a/project/src/ui/MouseEvent.cpp +++ b/project/src/ui/MouseEvent.cpp @@ -77,13 +77,14 @@ namespace lime { MouseEvent* eventObject = (MouseEvent*)MouseEvent::eventObject->Get (); eventObject->button = event->button; - eventObject->clickCount = event->clickCount; eventObject->movementX = event->movementX; eventObject->movementY = event->movementY; eventObject->type = event->type; eventObject->windowID = event->windowID; eventObject->x = event->x; eventObject->y = event->y; + eventObject->clickCount = event->clickCount; + } diff --git a/src/lime/_internal/backend/html5/HTML5Window.hx b/src/lime/_internal/backend/html5/HTML5Window.hx index ec229216f..3af8f908f 100644 --- a/src/lime/_internal/backend/html5/HTML5Window.hx +++ b/src/lime/_internal/backend/html5/HTML5Window.hx @@ -803,7 +803,7 @@ class HTML5Window if (touch == primaryTouch) { - parent.onMouseDown.dispatch(x, y, 0); + parent.onMouseDown.dispatch(x, y, 0, event.detail); } } else @@ -839,7 +839,7 @@ class HTML5Window if (touch == primaryTouch) { - parent.onMouseUp.dispatch(x, y, 0); + parent.onMouseUp.dispatch(x, y, 0, event.detail); primaryTouch = null; } diff --git a/src/lime/_internal/backend/native/NativeApplication.hx b/src/lime/_internal/backend/native/NativeApplication.hx index 7516133a1..a571d0724 100644 --- a/src/lime/_internal/backend/native/NativeApplication.hx +++ b/src/lime/_internal/backend/native/NativeApplication.hx @@ -780,13 +780,14 @@ class NativeApplication @:keep /*private*/ class MouseEventInfo { public var button:Int; - public var clickCount:Int; public var movementX:Float; public var movementY:Float; public var type:MouseEventType; public var windowID:Int; public var x:Float; public var y:Float; + public var clickCount:Int; + public function new(type:MouseEventType = null, windowID:Int = 0, x:Float = 0, y:Float = 0, button:Int = 0, movementX:Float = 0, movementY:Float = 0, clickCount:Int = 0) {