From 2a983a136c65ed3c4b6d29e79b2bd36b31fb773b Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 21 Feb 2020 22:26:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/book/read/page/ChapterProvider.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt index 8d5cdc422..80db62d70 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt @@ -194,7 +194,9 @@ object ChapterProvider { //ζœ€εŽδΈ€θ‘Œ textLine.text = "$words\n" stringBuilder.append("\n") - var x = 0f + var x = if (ReadBookConfig.durConfig.titleCenter) + (visibleWidth - layout.getLineMax(lineIndex)) / 2 + else 0f for (i in words.indices) { val char = words[i].toString() val cw = StaticLayout.getDesiredWidth(char, titlePaint)