fix: extend left adaptive stick activation to the screen edge

This commit is contained in:
sanogueralorenzo authored and Kurt Himebauch committed 2026-11-05 11:43:46 -05:00
1 parent e1fe6f99cf
commit d8c1bc6059
2 files changed
+67 -3

No files matched your search

@@ -696,7 +696,7 @@ class OnScreenControls(
if (x < safe.left || x >= width - safe.right || y < safe.top || y >= height - safe.bottom) return null
if (controls.any { it.stick < 0 && isVisible(it) && it.contains(x, y, it.radius, 5f) }) return null
return controls.filter {
val dx = x - it.cx
val dx = if (it.stick == 0) max(0f, x - it.cx) else x - it.cx
val dy = y - it.cy
val reach = it.radius * 1.4f * sqrt(1.5f)
it.stick >= 0 && isVisible(it) && it.pressedBy == -1 && dx * dx + dy * dy <= reach * reach