Compare commits

..
5 Commits
Author SHA1 Message Date
tarsin afbe0a4de5 Release 1.8.8.3
Releases / Build (push) Has been cancelled
2023-05-26 15:46:41 +08:00
tarsin 0a5cdf7c80 Fixup aa1e2102fc 2023-05-26 15:46:11 +08:00
tarsin 9d689923ac Fixup unsafe Composable behaviour 2023-05-26 15:45:58 +08:00
tarsin 98c5ae7490 Workaround aspect is NaN, Resolve #1116 2023-05-26 15:45:48 +08:00
tarsin 868ac22c69 Fix wrong thumb crop behaviour 2023-05-26 15:45:38 +08:00
6 changed files with 7 additions and 7 deletions

No files matched your search

+2 -2
View File
@@ -57,8 +57,8 @@ android {
applicationId = "moe.tarsin.ehviewer"
minSdk = 28
targetSdk = 33
versionCode = 180041
versionName = "1.8.8.2"
versionCode = 180042
versionName = "1.8.8.3"
resourceConfigurations.addAll(
listOf(
"zh",
@@ -41,7 +41,7 @@ fun SpiderInfo.write(file: UniFile) {
suspend fun SpiderInfo.saveToCache() {
runSuspendCatching {
spiderInfoCache.edit(gid.toString()) {
data.toFile().writeBytes(Cbor.encodeToByteArray(this))
data.toFile().writeBytes(Cbor.encodeToByteArray(this@saveToCache))
}
}.onFailure {
it.printStackTrace()
@@ -39,7 +39,7 @@ fun EhAsyncCropThumb(
key: GalleryInfo,
modifier: Modifier = Modifier,
) {
var contentScale by remember { mutableStateOf(ContentScale.Fit) }
var contentScale by remember(key.gid) { mutableStateOf(ContentScale.Fit) }
AsyncImage(
model = requestOf(key),
contentDescription = null,
@@ -129,7 +129,7 @@ fun GalleryInfoGridItem(
info: GalleryInfo,
modifier: Modifier = Modifier,
) {
val aspect = (info.thumbWidth.toFloat() / info.thumbHeight).coerceIn(0.33F, 1.5F)
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(
@@ -44,7 +44,7 @@ fun EhAsyncPreview(
model: GalleryPreview,
modifier: Modifier = Modifier,
) {
var contentScale by remember { mutableStateOf(ContentScale.Fit) }
var contentScale by remember(model.imageKey) { mutableStateOf(ContentScale.Fit) }
AsyncImage(
model = requestOf(model),
contentDescription = null,
@@ -1253,7 +1253,7 @@ private fun CompanionAsyncThumb(
path: UniFile,
modifier: Modifier = Modifier,
) {
var contentScale by remember { mutableStateOf(ContentScale.Fit) }
var contentScale by remember(info.gid) { mutableStateOf(ContentScale.Fit) }
val coroutineScope = rememberCoroutineScope { Dispatchers.IO }
val context = LocalContext.current
var localReq by remember(info.gid) {