This commit is contained in:
Horis 2024-02-24 09:39:31 +08:00
parent 952fc96574
commit 8e28ae1c4a
3 changed files with 8 additions and 0 deletions

View File

@ -536,6 +536,9 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at
}
private fun upSelectChars() {
if (!selectStart.isSelected() || !selectEnd.isSelected()) {
return
}
val last = if (callBack.isScroll) 2 else 0
val textPos = TextPos(0, 0, 0)
for (relativePos in 0..last) {

View File

@ -104,6 +104,7 @@ data class TextChapter(
* @return 已读长度
*/
fun getReadLength(pageIndex: Int): Int {
if (pageIndex < 0) return 0
return pages[min(pageIndex, lastIndex)].lines.first().chapterPosition
/*
var length = 0

View File

@ -69,4 +69,8 @@ data class TextPos(
isLast = false
}
fun isSelected(): Boolean {
return lineIndex >= 0 && columnIndex >= 0
}
}