From ebd09051530931572c49d1b2b420bec3577035ff Mon Sep 17 00:00:00 2001 From: Sword <99792114+Sword352@users.noreply.github.com> Date: Mon, 1 Apr 2024 08:58:44 +0200 Subject: [PATCH 1/3] isDragging helper --- haxe/ui/dragdrop/DragManager.hx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/haxe/ui/dragdrop/DragManager.hx b/haxe/ui/dragdrop/DragManager.hx index 10ce443e8..b9b45046c 100644 --- a/haxe/ui/dragdrop/DragManager.hx +++ b/haxe/ui/dragdrop/DragManager.hx @@ -24,6 +24,11 @@ class DragManager { // Instance //**************************************************************************************************** + public var dragging(get, never):Bool; + inline function get_dragging():Bool { + return isDragging(); + } + private var _dragComponents:Map; private var _mouseTargetToDragTarget:Map; @@ -37,6 +42,13 @@ class DragManager { _mouseTargetToDragTarget = new Map(); } + /** + * Returns true if a component is being dragged + */ + public function isDragging():Bool { + return _currentComponent != null; + } + /** * Returns the current DragOptions for a given component previously registered * @param component From fbaa1008f1ee0196f702ae7b1aabe0f0aab094f9 Mon Sep 17 00:00:00 2001 From: Sword <99792114+Sword352@users.noreply.github.com> Date: Mon, 1 Apr 2024 11:05:56 +0200 Subject: [PATCH 2/3] did the following changes --- haxe/ui/dragdrop/DragManager.hx | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/haxe/ui/dragdrop/DragManager.hx b/haxe/ui/dragdrop/DragManager.hx index b9b45046c..bd4472b0c 100644 --- a/haxe/ui/dragdrop/DragManager.hx +++ b/haxe/ui/dragdrop/DragManager.hx @@ -24,9 +24,12 @@ class DragManager { // Instance //**************************************************************************************************** - public var dragging(get, never):Bool; - inline function get_dragging():Bool { - return isDragging(); + /** + * Whether a component is currently being dragged + */ + public var isDragging(get, never):Bool; + inline function get_isDragging():Bool { + return _currentComponent != null; } private var _dragComponents:Map; @@ -42,13 +45,6 @@ class DragManager { _mouseTargetToDragTarget = new Map(); } - /** - * Returns true if a component is being dragged - */ - public function isDragging():Bool { - return _currentComponent != null; - } - /** * Returns the current DragOptions for a given component previously registered * @param component From eaf7eb17bc73b337791f15dec6c6f8640107c313 Mon Sep 17 00:00:00 2001 From: Sword <99792114+Sword352@users.noreply.github.com> Date: Mon, 1 Apr 2024 11:07:42 +0200 Subject: [PATCH 3/3] Update DragManager.hx --- haxe/ui/dragdrop/DragManager.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haxe/ui/dragdrop/DragManager.hx b/haxe/ui/dragdrop/DragManager.hx index bd4472b0c..ef78e58b7 100644 --- a/haxe/ui/dragdrop/DragManager.hx +++ b/haxe/ui/dragdrop/DragManager.hx @@ -28,7 +28,7 @@ class DragManager { * Whether a component is currently being dragged */ public var isDragging(get, never):Bool; - inline function get_isDragging():Bool { + function get_isDragging():Bool { return _currentComponent != null; }