|
|
@ -161,6 +161,10 @@ object ChapterProvider { |
|
|
|
desiredWidth: Float |
|
|
|
desiredWidth: Float |
|
|
|
) { |
|
|
|
) { |
|
|
|
var x = 0f |
|
|
|
var x = 0f |
|
|
|
|
|
|
|
if (!ReadBookConfig.textFullJustify) { |
|
|
|
|
|
|
|
addCharsToLineLast(textLine, words, textPaint, x) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
val bodyIndent = ReadBookConfig.bodyIndent |
|
|
|
val bodyIndent = ReadBookConfig.bodyIndent |
|
|
|
val icw = StaticLayout.getDesiredWidth(bodyIndent, textPaint) / bodyIndent.length |
|
|
|
val icw = StaticLayout.getDesiredWidth(bodyIndent, textPaint) / bodyIndent.length |
|
|
|
bodyIndent.toStringArray().forEach { |
|
|
|
bodyIndent.toStringArray().forEach { |
|
|
@ -186,6 +190,10 @@ object ChapterProvider { |
|
|
|
desiredWidth: Float, |
|
|
|
desiredWidth: Float, |
|
|
|
startX: Float |
|
|
|
startX: Float |
|
|
|
) { |
|
|
|
) { |
|
|
|
|
|
|
|
if (!ReadBookConfig.textFullJustify) { |
|
|
|
|
|
|
|
addCharsToLineLast(textLine, words, textPaint, startX) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
val gapCount: Int = words.length - 1 |
|
|
|
val gapCount: Int = words.length - 1 |
|
|
|
val d = (visibleWidth - desiredWidth) / gapCount |
|
|
|
val d = (visibleWidth - desiredWidth) / gapCount |
|
|
|
var x = startX |
|
|
|
var x = startX |
|
|
|