mirror of
https://github.com/gedoor/legado.git
synced 2024-07-17 00:58:29 +08:00
优化
This commit is contained in:
parent
8311a0508c
commit
9d1aa1c5d6
@ -180,6 +180,8 @@ object ChapterProvider {
|
|||||||
durY = it.second
|
durY = it.second
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
textPages.last().lines.last().isParagraphEnd = true
|
||||||
|
stringBuilder.append("\n")
|
||||||
durY += titleBottomSpacing
|
durY += titleBottomSpacing
|
||||||
}
|
}
|
||||||
contents.forEach { content ->
|
contents.forEach { content ->
|
||||||
@ -269,6 +271,8 @@ object ChapterProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
textPages.last().lines.last().isParagraphEnd = true
|
||||||
|
stringBuilder.append("\n")
|
||||||
}
|
}
|
||||||
val textPage = textPages.last()
|
val textPage = textPages.last()
|
||||||
val endPadding = 20.dpToPx()
|
val endPadding = 20.dpToPx()
|
||||||
@ -481,7 +485,6 @@ object ChapterProvider {
|
|||||||
lineIndex == layout.lineCount - 1 -> {
|
lineIndex == layout.lineCount - 1 -> {
|
||||||
//最后一行
|
//最后一行
|
||||||
textLine.text = lineText
|
textLine.text = lineText
|
||||||
textLine.isParagraphEnd = true
|
|
||||||
//标题x轴居中
|
//标题x轴居中
|
||||||
val startX = if (
|
val startX = if (
|
||||||
isTitle &&
|
isTitle &&
|
||||||
@ -523,9 +526,6 @@ object ChapterProvider {
|
|||||||
}
|
}
|
||||||
calcTextLinePosition(textPages, textLine, stringBuilder.length)
|
calcTextLinePosition(textPages, textLine, stringBuilder.length)
|
||||||
stringBuilder.append(lineText)
|
stringBuilder.append(lineText)
|
||||||
if (textLine.isParagraphEnd) {
|
|
||||||
stringBuilder.append("\n")
|
|
||||||
}
|
|
||||||
textLine.upTopBottom(durY, textHeight, fontMetrics)
|
textLine.upTopBottom(durY, textHeight, fontMetrics)
|
||||||
val textPage = textPages.last()
|
val textPage = textPages.last()
|
||||||
textPage.addLine(textLine)
|
textPage.addLine(textLine)
|
||||||
|
Loading…
Reference in New Issue
Block a user