diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java index 85f2b5b8..ba39b2f4 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java @@ -488,7 +488,7 @@ abstract class CameraController implements SizeSelectors.minWidth(targetMinSize.getWidth())); SizeSelector matchAll = SizeSelectors.or( SizeSelectors.and(matchRatio, matchSize), - matchRatio, // If couldn't match both, match ratio. + SizeSelectors.and(matchRatio, SizeSelectors.biggest()), // If couldn't match both, match ratio and biggest. SizeSelectors.biggest() // If couldn't match any, take the biggest. ); Size result = matchAll.select(previewSizes).get(0);