Skip to content

Commit

Permalink
Return proper center coordinates for widgets (#258)
Browse files Browse the repository at this point in the history
The button width / height return the center values of the native button. At larger scale modes, the disparity grows enough that other buttons can sometimes be pressed when overlapping each other because it doesn't return the actual center coordinates.
  • Loading branch information
DigiEggz committed Dec 27, 2023
1 parent de4ed4b commit 47dc1d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flixel/addons/ui/FlxUICursor.hx
Expand Up @@ -934,8 +934,8 @@ class FlxUICursor extends FlxUISprite
}

// get center point of object
widgetPoint.x += currWidget.width / 2;
widgetPoint.y += currWidget.height / 2;
widgetPoint.x += currWidget.width * Camera.totalScaleX * 0.5;
widgetPoint.y += currWidget.height * Camera.totalScaleY * 0.5;

return widgetPoint;
}
Expand Down

0 comments on commit 47dc1d6

Please sign in to comment.