Skip to content

Commit

Permalink
fix offset between pin and crosshair
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed Oct 29, 2024
1 parent 101c5e9 commit 4cd495b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4cd495b

Please sign in to comment.