Viewer navigation (#3869)
* Viewer navigation Co-authored-by: Harsh Parekh <h.x.dev@outlook.com> * Match current reader behavior and add ability to invert it * A bit of clean up * Clean up inversion * Only create navigator when changed and change tap zone when invertTapping is changed * Clean up PagerConfig * Change how Viewer navigation works * Add Edge Navigation Co-authored-by: Harsh Parekh <h.x.dev@outlook.com>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package eu.kanade.tachiyomi.util.lang
|
||||
|
||||
import android.graphics.RectF
|
||||
import eu.kanade.tachiyomi.data.preference.PreferenceValues
|
||||
|
||||
fun RectF.invert(invertMode: PreferenceValues.TappingInvertMode): RectF {
|
||||
val horizontal = invertMode.shouldInvertHorizontal
|
||||
val vertical = invertMode.shouldInvertVertical
|
||||
return when {
|
||||
horizontal && vertical -> RectF(1f - this.right, 1f - this.bottom, 1f - this.left, 1f - this.top)
|
||||
vertical -> RectF(this.left, 1f - this.bottom, this.right, 1f - this.top)
|
||||
horizontal -> RectF(1f - this.right, this.top, 1f - this.left, this.bottom)
|
||||
else -> this
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user