mirror of
https://github.com/immich-app/immich.git
synced 2025-08-11 09:16:31 -04:00
cleaner bounds check
This commit is contained in:
parent
41506a00bf
commit
d8000b9f8a
@ -60,12 +60,10 @@ extension MapBounds on $RemoteExifEntityTable {
|
|||||||
final southwest = bounds.southwest;
|
final southwest = bounds.southwest;
|
||||||
final northeast = bounds.northeast;
|
final northeast = bounds.northeast;
|
||||||
|
|
||||||
if (southwest.longitude <= northeast.longitude) {
|
final latInBounds = latitude.isBetweenValues(southwest.latitude, northeast.latitude);
|
||||||
return latitude.isBetweenValues(southwest.latitude, northeast.latitude) &
|
final longInBounds = southwest.longitude <= northeast.longitude
|
||||||
longitude.isBetweenValues(southwest.longitude, northeast.longitude);
|
? longitude.isBetweenValues(southwest.longitude, northeast.longitude)
|
||||||
} else {
|
: (longitude.isBiggerOrEqualValue(southwest.longitude) | longitude.isSmallerOrEqualValue(northeast.longitude));
|
||||||
return latitude.isBetweenValues(southwest.latitude, northeast.latitude) &
|
return latInBounds & longInBounds;
|
||||||
(longitude.isBiggerOrEqualValue(southwest.longitude) | longitude.isSmallerOrEqualValue(northeast.longitude));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user