@@ -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) {
@@ -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
@@ -69,4 +69,8 @@ data class TextPos(
isLast = false
+ fun isSelected(): Boolean {
+ return lineIndex >= 0 && columnIndex >= 0
+