Fixup unsafe Composable behaviour

This commit is contained in:
tarsin committed 2023-05-26 15:45:58 +08:00
1 parent 98c5ae7490
commit 9d689923ac
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(