优化代码

pull/357/head
gedoor 5 years ago
parent ff21aee1a4
commit 563a38e4c1
  1. 9
      app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt

@ -159,14 +159,15 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at
lineBottom: Float, lineBottom: Float,
) { ) {
textLine.textChars.forEach { textChar -> textLine.textChars.forEach { textChar ->
ReadBook.book?.let { book ->
val rectF = RectF(textChar.start, lineTop, textChar.end, lineBottom) val rectF = RectF(textChar.start, lineTop, textChar.end, lineBottom)
ImageProvider.getImage(ReadBook.book!!, ImageProvider.getImage(book, textPage.chapterIndex, textChar.charData, true)
textPage.chapterIndex, ?.let {
textChar.charData,
true)?.let {
canvas.drawBitmap(it, null, rectF, null) canvas.drawBitmap(it, null, rectF, null)
} }
} }
}
} }
/** /**

Loading…
Cancel
Save