mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-27 08:16:36 +03: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
1 changed files with 2 additions and 2 deletions
|
@ -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 a new issue