From 4cd495b5d3abbbb99ace6d2942efdf0cea338a06 Mon Sep 17 00:00:00 2001 From: Tobias Zwick Date: Tue, 29 Oct 2024 17:07:46 +0100 Subject: [PATCH] fix offset between pin and crosshair --- .../streetcomplete/screens/main/controls/Crosshair.kt | 2 +- .../java/de/westnordost/streetcomplete/ui/theme/Dimensions.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/Crosshair.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/Crosshair.kt index 3f26aa8af4..636a8c0bfa 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/Crosshair.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/Crosshair.kt @@ -25,7 +25,7 @@ fun Crosshair(modifier: Modifier = Modifier) { BoxWithConstraints(modifier.fillMaxSize()) { val isLandscape = maxWidth > maxHeight val crosshairOffsetX = if (isLandscape) getMaxQuestFormWidth(maxWidth) else 0.dp - val crosshairOffsetY = if (isLandscape) 0.dp else getQuestFormPeekHeight(maxHeight) + val crosshairOffsetY = if (isLandscape) 0.dp else getQuestFormPeekHeight(isLandscape) Icon( painter = painterResource(R.drawable.crosshair), diff --git a/app/src/main/java/de/westnordost/streetcomplete/ui/theme/Dimensions.kt b/app/src/main/java/de/westnordost/streetcomplete/ui/theme/Dimensions.kt index 7a01a19c69..b450e05f42 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/ui/theme/Dimensions.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/ui/theme/Dimensions.kt @@ -8,6 +8,6 @@ fun getMaxQuestFormWidth(totalWidth: Dp): Dp = else if (totalWidth >= 600.dp) 360.dp else 480.dp -fun getQuestFormPeekHeight(totalHeight: Dp): Dp = - if (totalHeight >= 720.dp) 442.dp +fun getQuestFormPeekHeight(isLandscape: Boolean): Dp = + if (isLandscape) 442.dp else 352.dp