Skip to content

Commit

Permalink
Merge pull request #46 from KovalevAndrey/fix-clipping-animation
Browse files Browse the repository at this point in the history
Fix clipping animation and content scale
  • Loading branch information
KovalevAndrey authored Oct 25, 2023
2 parents 23db6b6 + 09188d8 commit 5cda48b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fun CallToActionScreen(
) {
EmbeddableResourceImage(
path = "bumble_droidcon.jpg",
contentScale = ContentScale.FillBounds,
contentScale = ContentScale.Fit,
modifier = modifier
.fillMaxSize()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,29 +76,14 @@ class DottedMeshShape(
destRangeMin = 0f,
destRangeMax = targetRadius
)

// Clip with ovals when you see them, but stick with rectangles otherwise. This
// helps make clipping faster and prevents dropping frames.
if (radius < clampRadius) {
addOval(
Rect(
left = center.x - radius,
top = center.y - radius,
right = center.x + radius,
bottom = center.y + radius,
),
)
} else {
addRect(
Rect(
left = center.x - halfMeshWidth,
top = center.y - halfMeshHeight,
right = center.x + halfMeshWidth,
bottom = center.y + halfMeshHeight,
),
)
}

addOval(
Rect(
left = center.x - radius,
top = center.y - radius,
right = center.x + radius,
bottom = center.y + radius,
),
)
}
}
}
Expand Down

0 comments on commit 5cda48b

Please sign in to comment.