Skip to content

Commit c2d8a7b

Browse files
committed
fix: 🐛 修复自动排版
1 parent d785c99 commit c2d8a7b

File tree

1 file changed

+7
-0
lines changed
  • composeApp/src/commonMain/kotlin/top/kagg886/pmf/ui/util

1 file changed

+7
-0
lines changed

composeApp/src/commonMain/kotlin/top/kagg886/pmf/ui/util/rich-text.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
88
import androidx.compose.foundation.text.InlineTextContent
99
import androidx.compose.foundation.text.appendInlineContent
1010
import androidx.compose.material3.HorizontalDivider
11+
import androidx.compose.material3.LocalTextStyle
1112
import androidx.compose.material3.MaterialTheme
1213
import androidx.compose.material3.Text
1314
import androidx.compose.runtime.*
@@ -20,10 +21,12 @@ import androidx.compose.ui.platform.LocalDensity
2021
import androidx.compose.ui.text.*
2122
import androidx.compose.ui.text.font.FontWeight
2223
import androidx.compose.ui.text.style.TextDecoration
24+
import androidx.compose.ui.text.style.TextIndent
2325
import androidx.compose.ui.unit.sp
2426
import cafe.adriel.voyager.navigator.LocalNavigator
2527
import cafe.adriel.voyager.navigator.currentOrThrow
2628
import top.kagg886.pixko.module.illust.Illust
29+
import top.kagg886.pmf.backend.AppConfig
2730
import top.kagg886.pmf.ui.component.ImagePreviewer
2831
import top.kagg886.pmf.ui.component.ProgressedAsyncImage
2932
import top.kagg886.pmf.ui.route.main.detail.illust.IllustDetailScreen
@@ -177,6 +180,10 @@ fun RichText(
177180
Text(
178181
text = annotateString,
179182
inlineContent = inlineNode,
183+
style = if (AppConfig.autoTypo) TextStyle(
184+
textIndent = TextIndent(firstLine = 24.sp),
185+
lineHeight = 24.sp
186+
) else LocalTextStyle.current,
180187
modifier = modifier.onGloballyPositioned {
181188
screenWidth = with(density) {
182189
it.boundsInParent().width.toSp()

0 commit comments

Comments
 (0)