From a795f2256eb9992d1d7c4df3fe49ed7597ae2722 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sun, 19 Sep 2021 19:50:34 +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 --- .../legado/app/ui/widget/image/CoverImageView.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt b/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt index 80130b627..a371b69f0 100644 --- a/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt @@ -84,10 +84,6 @@ class CoverImageView @JvmOverloads constructor( close() } } - namePaint.textSize = width / 6 - namePaint.strokeWidth = namePaint.textSize / 10 - authorPaint.textSize = width / 8 - authorPaint.strokeWidth = authorPaint.textSize / 10 } override fun onDraw(canvas: Canvas) { @@ -104,6 +100,8 @@ class CoverImageView @JvmOverloads constructor( var startX = width * 0.2f var startY = height * 0.2f name?.toStringArray()?.let { name -> + namePaint.textSize = width / 7 + namePaint.strokeWidth = namePaint.textSize / 10 name.forEach { namePaint.color = Color.WHITE namePaint.style = Paint.Style.STROKE @@ -112,14 +110,16 @@ class CoverImageView @JvmOverloads constructor( namePaint.style = Paint.Style.FILL canvas.drawText(it, startX, startY, namePaint) startY += namePaint.textHeight - if (startY > height * 0.9) { + if (startY > height * 0.8) { return@let } } } - startX = width * 0.8f - startY = height * 0.7f author?.toStringArray()?.let { author -> + startX = width * 0.8f + startY = height * 0.7f + authorPaint.textSize = width / 9 + authorPaint.strokeWidth = authorPaint.textSize / 10 author.forEach { authorPaint.color = Color.WHITE authorPaint.style = Paint.Style.STROKE