From 274218cf228f5dfade2a11f053bb4fe1a7d11ed8 Mon Sep 17 00:00:00 2001 From: RS156 Date: Sun, 2 Apr 2023 00:22:15 +0530 Subject: [PATCH] Make center zoom start vertically centered too (#8849) Update ReaderPageImageView.kt "true center" Zoom start position #8747. Changed zoom position to get true center value. --- .../kanade/tachiyomi/ui/reader/viewer/ReaderPageImageView.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderPageImageView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderPageImageView.kt index 49ad3fb1d..f010e9c36 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderPageImageView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderPageImageView.kt @@ -115,7 +115,7 @@ open class ReaderPageImageView @JvmOverloads constructor( val point = when (config!!.zoomStartPosition) { ZoomStartPosition.LEFT -> if (forward) PointF(0F, 0F) else PointF(sWidth.toFloat(), 0F) ZoomStartPosition.RIGHT -> if (forward) PointF(sWidth.toFloat(), 0F) else PointF(0F, 0F) - ZoomStartPosition.CENTER -> center.also { it?.y = 0F } + ZoomStartPosition.CENTER -> center } val targetScale = height.toFloat() / sHeight.toFloat() @@ -249,7 +249,7 @@ open class ReaderPageImageView @JvmOverloads constructor( when (config?.zoomStartPosition) { ZoomStartPosition.LEFT -> setScaleAndCenter(scale, PointF(0F, 0F)) ZoomStartPosition.RIGHT -> setScaleAndCenter(scale, PointF(sWidth.toFloat(), 0F)) - ZoomStartPosition.CENTER -> setScaleAndCenter(scale, center.also { it?.y = 0F }) + ZoomStartPosition.CENTER -> setScaleAndCenter(scale, center) null -> {} } }