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) {