fix(input): edited on-screen layouts keep their places and a 100% size leaves docked controls unchanged (#3322)

This commit is contained in:
MaxsTechReview authored and GitHub committed 2026-11-27 04:40:57 -05:00
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)