feat: 优化代码

pull/134/head^2
kunfei 5 years ago
parent 479bfe0e7e
commit ff06f28eae
  1. 3
      app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt

@ -34,7 +34,8 @@ data class TextPage(
(layout.getLineBottom(lineIndex) - layout.getLineBaseline(lineIndex))) (layout.getLineBottom(lineIndex) - layout.getLineBaseline(lineIndex)))
textLine.lineBottom = textLine.lineBottom =
textLine.lineBase + ChapterProvider.contentPaint.fontMetrics.descent textLine.lineBase + ChapterProvider.contentPaint.fontMetrics.descent
var x = (ChapterProvider.visibleWidth - layout.getLineMax(lineIndex)) / 2 var x = ChapterProvider.paddingLeft +
(ChapterProvider.visibleWidth - layout.getLineMax(lineIndex)) / 2
textLine.text = textLine.text =
text.substring(layout.getLineStart(lineIndex), layout.getLineEnd(lineIndex)) text.substring(layout.getLineStart(lineIndex), layout.getLineEnd(lineIndex))
for (i in textLine.text.indices) { for (i in textLine.text.indices) {

Loading…
Cancel
Save