Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Feb 15, 2024
1 parent 8311a05 commit 9d1aa1c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ object ChapterProvider {
durY = it.second
}
}
textPages.last().lines.last().isParagraphEnd = true
stringBuilder.append("\n")
durY += titleBottomSpacing
}
contents.forEach { content ->
Expand Down Expand Up @@ -269,6 +271,8 @@ object ChapterProvider {
}
}
}
textPages.last().lines.last().isParagraphEnd = true
stringBuilder.append("\n")
}
val textPage = textPages.last()
val endPadding = 20.dpToPx()
Expand Down Expand Up @@ -481,7 +485,6 @@ object ChapterProvider {
lineIndex == layout.lineCount - 1 -> {
//最后一行
textLine.text = lineText
textLine.isParagraphEnd = true
//标题x轴居中
val startX = if (
isTitle &&
Expand Down Expand Up @@ -523,9 +526,6 @@ object ChapterProvider {
}
calcTextLinePosition(textPages, textLine, stringBuilder.length)
stringBuilder.append(lineText)
if (textLine.isParagraphEnd) {
stringBuilder.append("\n")
}
textLine.upTopBottom(durY, textHeight, fontMetrics)
val textPage = textPages.last()
textPage.addLine(textLine)
Expand Down

0 comments on commit 9d1aa1c

Please sign in to comment.