|
|
@@ -33,7 +33,6 @@ import kotlinx.coroutines.launch
|
|
|
import java.util.LinkedList
|
|
|
import java.util.Locale
|
|
|
import kotlin.coroutines.coroutineContext
|
|
|
-import kotlin.math.max
|
|
|
import kotlin.math.roundToInt
|
|
|
|
|
|
class TextChapterLayout(
|
|
|
@@ -447,9 +446,8 @@ class TextChapterLayout(
|
|
|
val textLine = TextLine(isTitle = isTitle)
|
|
|
if (durY + textHeight > visibleHeight) {
|
|
|
val textPage = pendingTextPage
|
|
|
- val height = max(durY, textPage.lines.lastOrNull()?.lineBottom ?: 0f)
|
|
|
- if (textPage.height < height) {
|
|
|
- textPage.height = height
|
|
|
+ if (textPage.height < durY) {
|
|
|
+ textPage.height = durY
|
|
|
}
|
|
|
if (doublePage && absStartX < viewWidth / 2) {
|
|
|
//当前页面左列结束
|
|
|
@@ -532,9 +530,8 @@ class TextChapterLayout(
|
|
|
val textPage = pendingTextPage
|
|
|
textPage.addLine(textLine)
|
|
|
durY += textHeight * lineSpacingExtra
|
|
|
- val height = max(durY, textPage.lines.lastOrNull()?.lineBottom ?: 0f)
|
|
|
- if (textPage.height < height) {
|
|
|
- textPage.height = height
|
|
|
+ if (textPage.height < durY) {
|
|
|
+ textPage.height = durY
|
|
|
}
|
|
|
}
|
|
|
durY += textHeight * paragraphSpacing / 10f
|