From 4421d2daf058d31a03cb36868370a596d48dd9ad Mon Sep 17 00:00:00 2001 From: ShaharMS Date: Sun, 18 Sep 2022 09:18:44 +0300 Subject: [PATCH] removed breaking changes --- src/lime/_internal/backend/native/NativeApplication.hx | 9 ++++++--- src/lime/app/Application.hx | 4 ++-- src/lime/ui/Window.hx | 8 ++++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/lime/_internal/backend/native/NativeApplication.hx b/src/lime/_internal/backend/native/NativeApplication.hx index a571d0724..a070d9530 100644 --- a/src/lime/_internal/backend/native/NativeApplication.hx +++ b/src/lime/_internal/backend/native/NativeApplication.hx @@ -336,18 +336,21 @@ class NativeApplication switch (mouseEventInfo.type) { case MOUSE_DOWN: - window.onMouseDown.dispatch(mouseEventInfo.x, mouseEventInfo.y, mouseEventInfo.button, mouseEventInfo.clickCount); + window.onMouseDown.dispatch(mouseEventInfo.x, mouseEventInfo.y, mouseEventInfo.button); + window.clickCount = mouseEventInfo.clickCount; case MOUSE_UP: - window.onMouseUp.dispatch(mouseEventInfo.x, mouseEventInfo.y, mouseEventInfo.button, mouseEventInfo.clickCount); + window.onMouseUp.dispatch(mouseEventInfo.x, mouseEventInfo.y, mouseEventInfo.button); + window.clickCount = mouseEventInfo.clickCount; case MOUSE_MOVE: window.onMouseMove.dispatch(mouseEventInfo.x, mouseEventInfo.y); window.onMouseMoveRelative.dispatch(mouseEventInfo.movementX, mouseEventInfo.movementY); + window.clickCount = mouseEventInfo.clickCount; case MOUSE_WHEEL: window.onMouseWheel.dispatch(mouseEventInfo.x, mouseEventInfo.y, UNKNOWN); - + window.clickCount = mouseEventInfo.clickCount; default: } } diff --git a/src/lime/app/Application.hx b/src/lime/app/Application.hx index 6905d380b..0cdf4d3e7 100644 --- a/src/lime/app/Application.hx +++ b/src/lime/app/Application.hx @@ -260,7 +260,7 @@ class Application extends Module @param y The current y coordinate of the mouse @param button The ID of the mouse button that was pressed **/ - public function onMouseDown(x:Float, y:Float, button:MouseButton, clickCount:Int):Void {} + public function onMouseDown(x:Float, y:Float, button:MouseButton):Void {} /** Called when a mouse move event is fired on the primary window @@ -282,7 +282,7 @@ class Application extends Module @param y The current y coordinate of the mouse @param button The ID of the button that was released **/ - public function onMouseUp(x:Float, y:Float, button:MouseButton, clickCount:Int):Void {} + public function onMouseUp(x:Float, y:Float, button:MouseButton):Void {} /** Called when a mouse wheel event is fired on the primary window diff --git a/src/lime/ui/Window.hx b/src/lime/ui/Window.hx index c430a30f6..27efcf8c6 100644 --- a/src/lime/ui/Window.hx +++ b/src/lime/ui/Window.hx @@ -67,10 +67,10 @@ class Window public var onLeave(default, null) = new EventVoid>(); public var onMaximize(default, null) = new EventVoid>(); public var onMinimize(default, null) = new EventVoid>(); - public var onMouseDown(default, null) = new EventFloat->MouseButton->Int->Void>(); + public var onMouseDown(default, null) = new EventFloat->MouseButton->Void>(); public var onMouseMove(default, null) = new EventFloat->Void>(); public var onMouseMoveRelative(default, null) = new EventFloat->Void>(); - public var onMouseUp(default, null) = new EventFloat->Int->Int->Void>(); + public var onMouseUp(default, null) = new EventFloat->Int->Void>(); public var onMouseWheel(default, null) = new EventFloat->MouseWheelMode->Void>(); public var onMove(default, null) = new EventFloat->Void>(); public var onRender(default, null) = new EventVoid>(); @@ -92,6 +92,10 @@ class Window public var x(get, set):Int; public var y(get, set):Int; + @:allow(openfl.display.Stage) + @:allow(lime.app.Application) + private var clickCount:Int = 0; + @:noCompletion private var __attributes:WindowAttributes; @:noCompletion private var __backend:WindowBackend; @:noCompletion private var __borderless:Bool;