feat: 优化代码

pull/115/head
kunfei 5 years ago
parent da365657ba
commit 9f78d86a80
  1. 2
      app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt
  2. 4
      app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt

@ -176,6 +176,7 @@ object ChapterProvider {
x = x1 x = x1
} }
} }
textLine.lineBottom = textLine.lineBottom + titlePaint.fontMetrics.descent
} }
durY += paragraphSpacing durY += paragraphSpacing
return durY return durY
@ -286,6 +287,7 @@ object ChapterProvider {
x = x1 x = x1
} }
} }
textLine.lineBottom = textLine.lineBottom + contentPaint.fontMetrics.descent
} }
durY += paragraphSpacing durY += paragraphSpacing
return durY return durY

@ -104,9 +104,9 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at
if (it.selected) { if (it.selected) {
canvas.drawRect( canvas.drawRect(
it.leftBottomPosition.x, it.leftBottomPosition.x,
it.rightTopPosition.y, textLine.lineTop,
it.rightTopPosition.x, it.rightTopPosition.x,
it.leftBottomPosition.y, textLine.lineBottom,
selectedPaint selectedPaint
) )
} }

Loading…
Cancel
Save