From b49bfc0fe6a957143e95ef3b75675c72680139f2 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 6 Aug 2026 02:59:32 +0000 Subject: [PATCH] Fix splash screen constraint scoping BoxWithConstraints exposes maxWidth and maxHeight on its own scope, but inside Column the implicit receiver becomes ColumnScope and they are no longer reachable, so the two font-size expressions failed to compile. Read the constraints once into locals at the top of the BoxWithConstraints body, which is what the Euchre and Sequence screens already do. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_015qjfMiPUDshdKEUa6vxqzN --- .../java/org/prolibertate/games/ui/SplashScreen.kt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/prolibertate/games/ui/SplashScreen.kt b/app/src/main/java/org/prolibertate/games/ui/SplashScreen.kt index a7be877..4edff5c 100644 --- a/app/src/main/java/org/prolibertate/games/ui/SplashScreen.kt +++ b/app/src/main/java/org/prolibertate/games/ui/SplashScreen.kt @@ -70,9 +70,15 @@ fun SplashScreen( } BoxWithConstraints(modifier = modifier.fillMaxSize().alpha(alpha)) { + // Read the constraints here and hold them in locals: inside Column the + // implicit receiver becomes ColumnScope, and maxWidth/maxHeight are no + // longer in scope. + val shortestSide = minOf(maxWidth, maxHeight).value + // Weave scale follows the screen so the cloth reads the same on a phone // and a tablet rather than turning into a fine grid on a large display. - val threadWidth = (minOf(maxWidth, maxHeight).value * 0.012f).dp + val threadWidth = (shortestSide * 0.012f).dp + val titleSize = (shortestSide * 0.13f).sp TartanBackground( modifier = Modifier.fillMaxSize(), threadWidth = threadWidth, @@ -96,7 +102,7 @@ fun SplashScreen( text = "Pro Libertate", style = TextStyle( fontFamily = CelticFontFamily, - fontSize = (minOf(maxWidth, maxHeight).value * 0.13f).sp, + fontSize = titleSize, color = Color(0xFFF7EFD8), textAlign = TextAlign.Center, shadow = Shadow( @@ -110,7 +116,7 @@ fun SplashScreen( text = "Games", style = TextStyle( fontFamily = CelticFontFamily, - fontSize = (minOf(maxWidth, maxHeight).value * 0.13f).sp, + fontSize = titleSize, color = Color(0xFFF2C200), textAlign = TextAlign.Center, shadow = Shadow(