Map zoom bar to zoom ratio instead of linear zoom
Linear zoom 0 switches to the ultra-wide lens on devices that support it, causing blurry images. Mapping to zoom ratios from 1.0x to maxZoomRatio keeps the main lens in use.
This commit is contained in:
@@ -624,7 +624,11 @@ class CameraActivity : AppCompatActivity() {
|
||||
progress: Int,
|
||||
fromUser: Boolean
|
||||
) {
|
||||
camera?.cameraControl?.setLinearZoom(progress / 100f)
|
||||
val maxRatio = camera?.cameraInfo?.zoomState?.value
|
||||
?.maxZoomRatio ?: return
|
||||
camera?.cameraControl?.setZoomRatio(
|
||||
1f + progress / 100f * (maxRatio - 1f)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onStartTrackingTouch(seekBar: SeekBar) {
|
||||
|
||||
Reference in New Issue
Block a user