From b6208a8149b825529359a857def0c569e8cb52bb Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 11 May 2021 15:09:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/read/page/ContentTextView.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt index 314051adc..1be7ce084 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt +++ b/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) + } } } }