Merge pull request #1814 from ag2s20150909/master

绘制Bitmap时抗锯齿
pull/1816/head
kunfei 3 years ago committed by GitHub
commit 66d68a861e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt

@ -3,6 +3,7 @@ package io.legado.app.ui.book.read.page
import android.content.Context import android.content.Context
import android.graphics.Canvas import android.graphics.Canvas
import android.graphics.Paint import android.graphics.Paint
import android.graphics.PaintFlagsDrawFilter
import android.graphics.RectF import android.graphics.RectF
import android.util.AttributeSet import android.util.AttributeSet
import android.view.View import android.view.View
@ -162,6 +163,9 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at
lineTop: Float, lineTop: Float,
lineBottom: Float lineBottom: Float
) { ) {
canvas.drawFilter =
PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG or Paint.FILTER_BITMAP_FLAG)
val book = ReadBook.book ?: return val book = ReadBook.book ?: return
val bitmap = ImageProvider.getImage( val bitmap = ImageProvider.getImage(
book, book,

Loading…
Cancel
Save