pull/2088/head
821938089 2 years ago
parent ff59f66cde
commit 4b2f9e6fbc
  1. 6
      app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt

@ -26,7 +26,7 @@ data class TextPage(
val lineSize get() = textLines.size val lineSize get() = textLines.size
val charSize get() = text.length val charSize get() = text.length
var isMsgOrTitlePage: Boolean = false var isMsgPage: Boolean = false
fun getLine(index: Int): TextLine { fun getLine(index: Int): TextLine {
return textLines.getOrElse(index) { return textLines.getOrElse(index) {
@ -79,8 +79,8 @@ data class TextPage(
@Suppress("DEPRECATION") @Suppress("DEPRECATION")
fun format(): TextPage { fun format(): TextPage {
if (textLines.isEmpty()) isMsgOrTitlePage = true if (textLines.isEmpty()) isMsgPage = true
if (isMsgOrTitlePage && ChapterProvider.viewWidth > 0) { if (isMsgPage && ChapterProvider.viewWidth > 0) {
textLines.clear() textLines.clear()
val visibleWidth = ChapterProvider.visibleRight - ChapterProvider.paddingLeft val visibleWidth = ChapterProvider.visibleRight - ChapterProvider.paddingLeft
val layout = StaticLayout( val layout = StaticLayout(

Loading…
Cancel
Save