mirror of
https://github.com/status-im/react-native-camera.git
synced 2026-09-01 06:01:14 +00:00
correct aproach for delta error
This commit is contained in:
@@ -123,8 +123,8 @@ public class RCTCamera {
|
||||
continue;
|
||||
}
|
||||
|
||||
int currentDelta = Math.abs(closestSize.width - matchWidth) * Math.abs(closestSize.height - matchHeight);
|
||||
int newDelta = Math.abs(size.width - matchWidth) * Math.abs(size.height - matchHeight);
|
||||
double currentDelta = Math.sqrt(Math.pow(closestSize.width - matchWidth,2) + Math.pow(closestSize.height - matchHeight,2));
|
||||
double newDelta = Math.sqrt(Math.pow(size.width - matchWidth,2) + Math.pow(size.height - matchHeight,2));
|
||||
|
||||
if (newDelta < currentDelta) {
|
||||
closestSize = size;
|
||||
|
||||
Reference in New Issue
Block a user