From 49a064acc0f86eb6d95764960089dddf9c372e3c Mon Sep 17 00:00:00 2001 From: Seb3thehacker Date: Mon, 12 Oct 2026 23:52:03 -0700 Subject: [PATCH] video: cars that give no touchscreen size get the largest picture up to 1080p --- .../java/app/seb3thehacker/gearslip/GearslipRunner.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gearslip/src/main/java/app/seb3thehacker/gearslip/GearslipRunner.kt b/gearslip/src/main/java/app/seb3thehacker/gearslip/GearslipRunner.kt index 60e8b55..955655d 100644 --- a/gearslip/src/main/java/app/seb3thehacker/gearslip/GearslipRunner.kt +++ b/gearslip/src/main/java/app/seb3thehacker/gearslip/GearslipRunner.kt @@ -863,13 +863,17 @@ class GearslipRunner( /** * The offered config that best fills the car's screen: the smallest whose visible width * reaches most of the touchscreen's, else the largest there is. Always taking the smallest - * put 800x480 on a 1540x720 Audi screen and stretched it. With no touchscreen size to go - * by, the smallest is still the safe choice. + * put 800x480 on a 1540x720 Audi screen and stretched it. A car that gives no touchscreen + * size gets the largest up to 1080p: a car only offers sizes it can show, and the 2024 VW + * (touchscreen 0x0) blurred 800x480 across a 1080p screen. */ private fun fitToScreen(offered: List): Int? { val known = offered.filter { videoConfigs.getOrNull(it)?.pixelSize() != null } fun pixels(idx: Int) = videoConfigs[idx].pixelCount() - if (touchWidth <= 0) return known.minByOrNull(::pixels) + if (touchWidth <= 0) { + return known.filter { pixels(it) <= 1920 * 1080 }.maxByOrNull(::pixels) + ?: known.minByOrNull(::pixels) + } val wide = known.filter { (videoConfigs[it].visibleSize()?.first ?: 0) >= touchWidth * 8 / 10 } return wide.minByOrNull(::pixels) ?: known.maxByOrNull(::pixels) }