mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-20 03:24:50 +00:00
Changed tolerances on zooming/panning snapping.
This commit is contained in:
parent
b9c7e0a8ca
commit
c3df9e5259
1 changed files with 5 additions and 2 deletions
|
@ -378,11 +378,14 @@ class GestureControlView : LinearLayout {
|
|||
return Math.max(width / w, height / h)
|
||||
}
|
||||
|
||||
private val _snapTranslationTolerance = 0.04f;
|
||||
private val _snapZoomTolerance = 0.04f;
|
||||
|
||||
private fun willSnapFill(): Boolean {
|
||||
val surfaceView = _surfaceView
|
||||
if (surfaceView != null) {
|
||||
val zoomScaleFactor = calculateZoomScaleFactor()
|
||||
if (Math.abs(_scaleFactor - zoomScaleFactor) < 0.05f && Math.abs(_translationX) / width < 0.03f && Math.abs(_translationY) / height < 0.03f) {
|
||||
if (Math.abs(_scaleFactor - zoomScaleFactor) < _snapZoomTolerance && Math.abs(_translationX) / width < _snapTranslationTolerance && Math.abs(_translationY) / height < _snapTranslationTolerance) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
@ -391,7 +394,7 @@ class GestureControlView : LinearLayout {
|
|||
}
|
||||
|
||||
private fun willSnapFit(): Boolean {
|
||||
return Math.abs(_scaleFactor - 1.0f) < 0.05f && Math.abs(_translationX) / width < 0.03f && Math.abs(_translationY) / height < 0.03f
|
||||
return Math.abs(_scaleFactor - 1.0f) < _snapZoomTolerance && Math.abs(_translationX) / width < _snapTranslationTolerance && Math.abs(_translationY) / height < _snapTranslationTolerance
|
||||
}
|
||||
|
||||
fun cancelHideJob() {
|
||||
|
|
Loading…
Add table
Reference in a new issue