This commit is contained in:
vcoppe
2026-10-03 13:40:49 +02:00
parent 87d6d5f30e
commit c6ad088947
+4 -4
View File
@@ -35,14 +35,14 @@ impl LngLatBounds {
pub fn extend(&mut self, coordinates: LngLat) {
self.sw.lng = self.sw.lng.min(coordinates.lng);
self.sw.lat = self.sw.lat.min(coordinates.lat);
self.ne.lng = self.ne.lng.min(coordinates.lng);
self.ne.lat = self.ne.lat.min(coordinates.lat);
self.ne.lng = self.ne.lng.max(coordinates.lng);
self.ne.lat = self.ne.lat.max(coordinates.lat);
}
pub fn merge(&mut self, other: &LngLatBounds) {
self.sw.lng = self.sw.lng.min(other.sw.lng);
self.sw.lat = self.sw.lat.min(other.sw.lat);
self.ne.lng = self.ne.lng.min(other.ne.lng);
self.ne.lat = self.ne.lat.min(other.ne.lat);
self.ne.lng = self.ne.lng.max(other.ne.lng);
self.ne.lat = self.ne.lat.max(other.ne.lat);
}
}