From 9f78d86a803fdd2a71825caf8e44b362624c7acf Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 23 Feb 2020 10:25:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/book/read/page/ChapterProvider.kt | 2 ++ .../java/io/legado/app/ui/book/read/page/ContentTextView.kt | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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 ) }