mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-06 21:15:43 +00:00
fix(input): edited on-screen layouts keep their places and a 100% size leaves docked controls unchanged (#3322)
This commit is contained in:
1 parent
f0a4b084d9
commit
c0506d53c9
2 files changed
+13
-4
No files matched your search
@@ -336,6 +336,16 @@ class OnScreenLayoutTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun dockedControlsStayInsideTheSafeAreaAtTheDefaultSizeWithoutAControllerKit() {
|
||||
SessionPrefs.setSteamController(context, SessionPrefs.CONTROLLER_NONE)
|
||||
ControllerPrefs.setSize(context, 100)
|
||||
val safe = Rect(40, 0, 60, 24)
|
||||
for ((w, h) in listOf(1080 to 200, 1200 to 540, 2208 to 800)) {
|
||||
val placed = OnScreenLayout.elements(context, gamepad(), w, h, safe, dock = OnScreenLayout.Dock(false, false))
|
||||
assertInside(placed.filter { it.id.startsWith("legacy:") }, w, h, safe)
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun anEditedLayoutKeepsItsAspectAndCornersWhenTheScreenRotates() {
|
||||
val corner = InputSurfaceElement(InputControl.A, .85f, .7f, .1f, .2f)
|
||||
val left = InputSurfaceElement(InputControl.LS, .05f, .5f, .2f, .4f)
|
||||
|
||||
Reference in new issue
Block a user