From 861f04c56acbc9eca1a1defc284664092b8d2962 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 20 Feb 2020 22:02:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/read/page/ChapterProvider.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt index d4d6310f7..ba08b92c4 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt @@ -139,6 +139,9 @@ object ChapterProvider { ) } + /** + * 标题 + */ private fun joinTitle( title: String, y: Int, @@ -218,6 +221,9 @@ object ChapterProvider { return durY } + /** + * 正文 + */ private fun joinBody( text: String, y: Int, @@ -255,6 +261,7 @@ object ChapterProvider { ) var words = text.substring(layout.getLineStart(lineIndex), layout.getLineEnd(lineIndex)) + stringBuilder.append(words) val desiredWidth = layout.getLineMax(lineIndex) if (lineIndex == 0 && layout.lineCount > 1) { //第一行 @@ -289,6 +296,7 @@ object ChapterProvider { } } else if (lineIndex == layout.lineCount - 1) { //最后一行 + stringBuilder.append("\n") var x = 0 for (i in words.indices) { val char = words[i].toString()