]> git.street.me.uk Git - andy/gpx.git/blobdiff - src/libgpx/route.php
Fix: Calculate bounds correctly
[andy/gpx.git] / src / libgpx / route.php
index e0364a73e0fe85a00df47f454973a66b48e935bc..1c7ab960f9aa5522089c26fd608e76a9b09e98c4 100644 (file)
@@ -105,7 +105,11 @@ class Route extends DataType
     if ($this->points !== null) {
       foreach ($this->points as $point) {
         $bounds = $point->getBounds();
-        $result = ($result === null ? $bounds : $result->extend($bounds));
+        if ($result === null) {
+          $result = $bounds;
+        } else {
+          $result->extend($bounds);
+        }
       }
     }
     return $result;