This commit is contained in:
Horis
2024-07-28 18:26:46 +08:00
parent 75949e0806
commit 489878fd0b
2 changed files with 3 additions and 1 deletions
@@ -952,6 +952,7 @@ class ReadBookActivity : BaseReadBookActivity(),
success: (() -> Unit)?
) {
lifecycleScope.launch {
binding.readView.cancelSelect()
binding.readView.upContent(relativePosition, resetPageOffset)
if (relativePosition == 0) {
upSeekBarProgress()
@@ -980,6 +981,7 @@ class ReadBookActivity : BaseReadBookActivity(),
override fun pageChanged() {
pageChanged = true
binding.readView.onPageChange()
binding.readView.cancelSelect()
handler.post {
upSeekBarProgress()
}
@@ -250,7 +250,7 @@ data class TextPage(
*/
fun getPosByLineColumn(lineIndex: Int, columnIndex: Int): Int {
var length = 0
val maxIndex = min(lineIndex, lineSize)
val maxIndex = min(lineIndex, lineSize - 1)
for (index in 0 until maxIndex) {
length += textLines[index].charSize
if (textLines[index].isParagraphEnd) {