Fixup unsafe Composable behaviour

This commit is contained in:
tarsin committed 2023-05-26 15:22:50 +08:00
1 parent 2a34d6eb8b
commit f92ce637bf
1 file changed
+1 -2
@@ -129,8 +129,7 @@ fun GalleryInfoGridItem(
info: GalleryInfo,
modifier: Modifier = Modifier,
) {
var aspect = (info.thumbWidth.toFloat() / info.thumbHeight).coerceIn(0.33F, 1.5F)
if (aspect.isNaN()) aspect = 1F
val aspect = (info.thumbWidth.toFloat() / info.thumbHeight).coerceIn(0.33F, 1.5F).takeUnless { it.isNaN() } ?: 1F
val color = EhUtils.getCategoryColor(info.category)
val simpleLang = info.simpleLanguage
ElevatedCard(