🚀 Coerce minimum paragraphHeight
* Coerced minimum paragraphHeight as the height of the line
This commit is contained in:
parent
08fb196e93
commit
170f4a8de9
1 changed files with 8 additions and 3 deletions
|
|
@ -68,6 +68,7 @@ data class ReaderScreen(val bookId: Int) : Screen, Parcelable {
|
||||||
val settingsState = settingsModel.state.collectAsStateWithLifecycle()
|
val settingsState = settingsModel.state.collectAsStateWithLifecycle()
|
||||||
|
|
||||||
val activity = LocalActivity.current
|
val activity = LocalActivity.current
|
||||||
|
val density = LocalDensity.current
|
||||||
val listState = rememberSaveable(
|
val listState = rememberSaveable(
|
||||||
state.value.listState,
|
state.value.listState,
|
||||||
saver = LazyListState.Saver
|
saver = LazyListState.Saver
|
||||||
|
|
@ -129,8 +130,13 @@ data class ReaderScreen(val bookId: Int) : Screen, Parcelable {
|
||||||
val verticalPadding = remember(mainState.value.verticalPadding) {
|
val verticalPadding = remember(mainState.value.verticalPadding) {
|
||||||
(mainState.value.verticalPadding * 4.5f).dp
|
(mainState.value.verticalPadding * 4.5f).dp
|
||||||
}
|
}
|
||||||
val paragraphHeight = remember(mainState.value.paragraphHeight) {
|
val paragraphHeight = remember(
|
||||||
(mainState.value.paragraphHeight * 3).dp
|
mainState.value.paragraphHeight,
|
||||||
|
mainState.value.lineHeight
|
||||||
|
) {
|
||||||
|
((mainState.value.paragraphHeight * 3).dp).coerceAtLeast(
|
||||||
|
with(density) { mainState.value.lineHeight.sp.toDp().value * 0.5f }.dp
|
||||||
|
)
|
||||||
}
|
}
|
||||||
val fontStyle = remember(mainState.value.isItalic) {
|
val fontStyle = remember(mainState.value.isItalic) {
|
||||||
when (mainState.value.isItalic) {
|
when (mainState.value.isItalic) {
|
||||||
|
|
@ -181,7 +187,6 @@ data class ReaderScreen(val bookId: Int) : Screen, Parcelable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val density = LocalDensity.current
|
|
||||||
val layoutDirection = LocalLayoutDirection.current
|
val layoutDirection = LocalLayoutDirection.current
|
||||||
val cutoutInsets = WindowInsets.displayCutout
|
val cutoutInsets = WindowInsets.displayCutout
|
||||||
val systemBarsInsets = WindowInsets.systemBarsIgnoringVisibility
|
val systemBarsInsets = WindowInsets.systemBarsIgnoringVisibility
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue