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 <[email protected]>
Claude-Session: https://claude.ai/code/session_015qjfMiPUDshdKEUa6vxqzN
This commit is contained in:
Claude
2026-08-06 02:59:32 +00:00
parent dbe76c34c4
commit b49bfc0fe6
@@ -70,9 +70,15 @@ fun SplashScreen(
} }
BoxWithConstraints(modifier = modifier.fillMaxSize().alpha(alpha)) { 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 // 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. // 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( TartanBackground(
modifier = Modifier.fillMaxSize(), modifier = Modifier.fillMaxSize(),
threadWidth = threadWidth, threadWidth = threadWidth,
@@ -96,7 +102,7 @@ fun SplashScreen(
text = "Pro Libertate", text = "Pro Libertate",
style = TextStyle( style = TextStyle(
fontFamily = CelticFontFamily, fontFamily = CelticFontFamily,
fontSize = (minOf(maxWidth, maxHeight).value * 0.13f).sp, fontSize = titleSize,
color = Color(0xFFF7EFD8), color = Color(0xFFF7EFD8),
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
shadow = Shadow( shadow = Shadow(
@@ -110,7 +116,7 @@ fun SplashScreen(
text = "Games", text = "Games",
style = TextStyle( style = TextStyle(
fontFamily = CelticFontFamily, fontFamily = CelticFontFamily,
fontSize = (minOf(maxWidth, maxHeight).value * 0.13f).sp, fontSize = titleSize,
color = Color(0xFFF2C200), color = Color(0xFFF2C200),
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
shadow = Shadow( shadow = Shadow(