pull/981/head
gedoor 4 years ago
parent 7ba47a113b
commit b6208a8149
  1. 7
      app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt

@ -23,6 +23,7 @@ import io.legado.app.ui.widget.dialog.PhotoDialog
import io.legado.app.utils.activity
import io.legado.app.utils.getCompatColor
import io.legado.app.utils.getPrefBoolean
import io.legado.app.utils.toastOnUi
import kotlinx.coroutines.CoroutineScope
import kotlin.math.min
@ -178,7 +179,11 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at
val div = (lineBottom - lineTop - h) / 2
RectF(textChar.start, lineTop + div, textChar.end, lineBottom - div)
}
canvas.drawBitmap(it, null, rectF, null)
kotlin.runCatching {
canvas.drawBitmap(it, null, rectF, null)
}.onFailure { e ->
context.toastOnUi(e.localizedMessage)
}
}
}
}

Loading…
Cancel
Save