mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 12:28:40 +00:00
fix: extend left adaptive stick activation to the screen edge
This commit is contained in:
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
|
||||
|
||||
Reference in new issue
Block a user