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
}
}
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

@ -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
)
}

Loading…
Cancel
Save