Skip to content

Commit

Permalink
fix for #24
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Mar 31, 2022
1 parent bfd99ec commit 2fc5882
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions haxe/ui/backend/heaps/MouseHelper.hx
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ class MouseHelper {
}

private static function onMouseMove(e:hxd.Event) {
currentMouseX = Window.getInstance().mouseX / Toolkit.scaleX;
currentMouseY = Window.getInstance().mouseY / Toolkit.scaleY;
currentMouseX = e.relX / Toolkit.scaleX;
currentMouseY = e.relY / Toolkit.scaleY;

var list = _callbacks.get(MouseEvent.MOUSE_MOVE);
if (list == null || list.length == 0) {
Expand All @@ -120,8 +120,8 @@ class MouseHelper {
list = list.copy();
var event = new MouseEvent(MouseEvent.MOUSE_MOVE);
@:privateAccess event._originalEvent = e;
event.screenX = Window.getInstance().mouseX / Toolkit.scaleX;
event.screenY = Window.getInstance().mouseY / Toolkit.scaleY;
event.screenX = e.relX / Toolkit.scaleX;
event.screenY = e.relY / Toolkit.scaleY;
for (l in list) {
l(event);
}
Expand All @@ -137,8 +137,8 @@ class MouseHelper {

var event = new MouseEvent(MouseEvent.MOUSE_DOWN);
@:privateAccess event._originalEvent = e;
event.screenX = Window.getInstance().mouseX / Toolkit.scaleX;
event.screenY = Window.getInstance().mouseY / Toolkit.scaleY;
event.screenX = e.relX / Toolkit.scaleX;
event.screenY = e.relY / Toolkit.scaleY;
event.data = e.button;
for (l in list) {
l(event);
Expand All @@ -155,8 +155,8 @@ class MouseHelper {

var event = new MouseEvent(MouseEvent.MOUSE_UP);
@:privateAccess event._originalEvent = e;
event.screenX = Window.getInstance().mouseX / Toolkit.scaleX;
event.screenY = Window.getInstance().mouseY / Toolkit.scaleY;
event.screenX = e.relX / Toolkit.scaleX;
event.screenY = e.relY / Toolkit.scaleY;
event.data = e.button;
for (l in list) {
l(event);
Expand Down

0 comments on commit 2fc5882

Please sign in to comment.