From c8fee0e12c3161fde21a9af5e731734a2f4d3242 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sun, 11 Jul 2021 20:04:49 +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/build.gradle | 1 - .../legado/app/ui/book/read/page/provider/ChapterProvider.kt | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0c509d7a3..19db5b208 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -133,7 +133,6 @@ dependencies { implementation "androidx.activity:activity-ktx:1.2.3" implementation "androidx.fragment:fragment-ktx:1.3.5" implementation 'androidx.preference:preference-ktx:1.1.1' - implementation "androidx.collection:collection-ktx:1.1.0" implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' implementation 'androidx.viewpager2:viewpager2:1.0.0' 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 5f8cd7622..814c8736d 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 @@ -419,8 +419,7 @@ object ChapterProvider { * 超出边界处理 */ private fun exceed(textLine: TextLine, words: Array) { - if (textLine.textChars.isEmpty()) return - val endX = textLine.textChars.last().end + val endX = textLine.textChars.lastOrNull()?.end ?: return if (endX > visibleRight) { val cc = (endX - visibleRight) / words.size for (i in 0..words.lastIndex) {