diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt index 3215c5464..8a4a46e06 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt @@ -176,6 +176,7 @@ object ChapterProvider { x = x1 } } + textLine.lineBottom = textLine.lineBottom + titlePaint.fontMetrics.descent } durY += paragraphSpacing return durY @@ -286,6 +287,7 @@ object ChapterProvider { x = x1 } } + textLine.lineBottom = textLine.lineBottom + contentPaint.fontMetrics.descent } durY += paragraphSpacing return durY diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt index 6267136fb..6902ae399 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt @@ -104,9 +104,9 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at if (it.selected) { canvas.drawRect( it.leftBottomPosition.x, - it.rightTopPosition.y, + textLine.lineTop, it.rightTopPosition.x, - it.leftBottomPosition.y, + textLine.lineBottom, selectedPaint ) }