mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -26,6 +26,7 @@ data class TextPage(
|
||||
|
||||
val lineSize get() = textLines.size
|
||||
val charSize get() = text.length
|
||||
var isMsgOrTitlePage: Boolean = false
|
||||
|
||||
fun getLine(index: Int): TextLine {
|
||||
return textLines.getOrElse(index) {
|
||||
@@ -78,7 +79,9 @@ data class TextPage(
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
fun format(): TextPage {
|
||||
if (textLines.isEmpty() && ChapterProvider.viewWidth > 0) {
|
||||
if (textLines.isEmpty()) isMsgOrTitlePage = true
|
||||
if (isMsgOrTitlePage && ChapterProvider.viewWidth > 0) {
|
||||
textLines.clear()
|
||||
val visibleWidth = ChapterProvider.visibleRight - ChapterProvider.paddingLeft
|
||||
val layout = StaticLayout(
|
||||
text, ChapterProvider.contentPaint, visibleWidth,
|
||||
|
||||
Reference in New Issue
Block a user