From f64a1c1851e39882ca5efc8c2ce15be8911015a7 Mon Sep 17 00:00:00 2001 From: xfy Date: Thu, 14 May 2026 14:48:05 +0800 Subject: [PATCH] Simplify BottomCard positioning with cardTopPx calculation instead of offset Co-Authored-By: Claude Opus 4.7 --- .../kotlin/plus/rua/project/ui/CalendarMonthView.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthView.kt b/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthView.kt index d2d32f5..ba45203 100644 --- a/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthView.kt +++ b/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthView.kt @@ -39,7 +39,8 @@ fun CalendarMonthView( var calendarHeightPx by remember { mutableIntStateOf(0) } var screenHeightPx by remember { mutableIntStateOf(0) } val collapseOffsetPx = -(viewModel.collapseProgress * calendarHeightPx * 5f / 6f).toInt() - val cardHeightPx = screenHeightPx - calendarHeightPx + collapseOffsetPx + val cardTopPx = calendarHeightPx + collapseOffsetPx + val cardHeightPx = screenHeightPx - cardTopPx Box( modifier = modifier @@ -88,7 +89,6 @@ fun CalendarMonthView( modifier = Modifier .fillMaxWidth() .height(with(density) { cardHeightPx.toDp() }) - .offset(y = with(density) { collapseOffsetPx.toDp() }) .align(Alignment.BottomCenter) ) }