correct aproach for delta error

This commit is contained in:
SteffenUlrich 2017-10-18 14:37:56 +02:00 committed by GitHub
parent 52b11f2d32
commit b5baca03e8

View File

@ -123,8 +123,8 @@ public class RCTCamera {
continue; continue;
} }
int currentDelta = Math.abs(closestSize.width - matchWidth) * Math.abs(closestSize.height - matchHeight); double currentDelta = Math.sqrt(Math.pow(closestSize.width - matchWidth,2) + Math.pow(closestSize.height - matchHeight,2));
int newDelta = Math.abs(size.width - matchWidth) * Math.abs(size.height - matchHeight); double newDelta = Math.sqrt(Math.pow(size.width - matchWidth,2) + Math.pow(size.height - matchHeight,2));
if (newDelta < currentDelta) { if (newDelta < currentDelta) {
closestSize = size; closestSize = size;