mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 08:01:50 +01:00
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.
This commit is contained in:
parent
c7d6509565
commit
274218cf22
@ -115,7 +115,7 @@ open class ReaderPageImageView @JvmOverloads constructor(
|
|||||||
val point = when (config!!.zoomStartPosition) {
|
val point = when (config!!.zoomStartPosition) {
|
||||||
ZoomStartPosition.LEFT -> if (forward) PointF(0F, 0F) else PointF(sWidth.toFloat(), 0F)
|
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.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()
|
val targetScale = height.toFloat() / sHeight.toFloat()
|
||||||
@ -249,7 +249,7 @@ open class ReaderPageImageView @JvmOverloads constructor(
|
|||||||
when (config?.zoomStartPosition) {
|
when (config?.zoomStartPosition) {
|
||||||
ZoomStartPosition.LEFT -> setScaleAndCenter(scale, PointF(0F, 0F))
|
ZoomStartPosition.LEFT -> setScaleAndCenter(scale, PointF(0F, 0F))
|
||||||
ZoomStartPosition.RIGHT -> setScaleAndCenter(scale, PointF(sWidth.toFloat(), 0F))
|
ZoomStartPosition.RIGHT -> setScaleAndCenter(scale, PointF(sWidth.toFloat(), 0F))
|
||||||
ZoomStartPosition.CENTER -> setScaleAndCenter(scale, center.also { it?.y = 0F })
|
ZoomStartPosition.CENTER -> setScaleAndCenter(scale, center)
|
||||||
null -> {}
|
null -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user