This commit is contained in:
Horis
2024-08-08 15:38:21 +08:00
parent fcfbcb387d
commit 3ac31ec7e4
@@ -290,11 +290,11 @@ data class TextPage(
fun draw(view: ContentTextView, canvas: Canvas, relativeOffset: Float) {
if (AppConfig.optimizeRender) {
render(view)
canvas.withTranslation(0f, relativeOffset + paddingTop) {
canvas.withTranslation(0f, relativeOffset) {
canvasRecorder.draw(this)
}
} else {
canvas.withTranslation(0f, relativeOffset + paddingTop) {
canvas.withTranslation(0f, relativeOffset) {
drawPage(view, this)
}
}
@@ -318,7 +318,7 @@ data class TextPage(
private fun drawPage(view: ContentTextView, canvas: Canvas) {
for (i in lines.indices) {
val line = lines[i]
canvas.withTranslation(0f, line.lineTop - paddingTop) {
canvas.withTranslation(0f, line.lineTop) {
line.draw(view, this)
}
}
@@ -326,7 +326,7 @@ data class TextPage(
fun render(view: ContentTextView): Boolean {
if (!isCompleted) return false
return canvasRecorder.recordIfNeeded(view.width, height.toInt()) {
return canvasRecorder.recordIfNeeded(view.width, view.height) {
drawPage(view, this)
}
}