mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 21:06:09 +00:00
Expand adaptive joystick activation area by fifty percent
This commit is contained in:
1 parent
f418b788bc
commit
0f75c0f3c2
2 files changed
+3
-2
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package com.droiddeck.launcher.input
|
||||
|
||||
import kotlin.math.sqrt
|
||||
import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Canvas
|
||||
@@ -120,7 +121,7 @@ class OnScreenControlsTest {
|
||||
val left = control("ls")
|
||||
val x = value(left, "cx")
|
||||
val y = value(left, "cy")
|
||||
val reach = value(left, "radius") * 1.4f
|
||||
val reach = value(left, "radius") * 1.4f * sqrt(1.5f)
|
||||
assertFalse(touch(MotionEvent.ACTION_DOWN, 1 to (x to y - reach - 1f)))
|
||||
assertTrue(touch(MotionEvent.ACTION_DOWN, 1 to (x to y - reach + 1f)))
|
||||
assertEquals(y - reach + 1f, value(left, "ay"), 0.001f)
|
||||
|
||||
Reference in new issue
Block a user