From 8add075fc4e10cc4db96995134f75ef8a2e46511 Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 6 Aug 2021 15:50:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/book/read/page/provider/ChapterProvider.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt index 9f3b17088..74d4734b9 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt @@ -343,8 +343,10 @@ object ChapterProvider { } x = x1 } - val words1 = words.copyOfRange(bodyIndent.length, words.size) - addCharsToLineMiddle(textLine, words1, textPaint, desiredWidth, x, srcList) + if (words.size > bodyIndent.length) { + val words1 = words.copyOfRange(bodyIndent.length, words.size) + addCharsToLineMiddle(textLine, words1, textPaint, desiredWidth, x, srcList) + } } /**