[gnome-maps/gnome-3-36] maps-file-tile-source: Fix off-by-one error computing bounds



commit dc364d27fab141ccf5dc9724264f6b54da040641
Author: Marcus Lundblad <ml update uu se>
Date:   Sun Apr 19 23:20:32 2020 +0200

    maps-file-tile-source: Fix off-by-one error computing bounds
    
    Fix an off-by-one error when computing the world bounds.
    The outer egde should be considered at the "outer bound"
    of the last tile in each dimension.
    
    Fixes #217

 lib/maps-file-tile-source.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/lib/maps-file-tile-source.c b/lib/maps-file-tile-source.c
index 0085d704..61e5f060 100644
--- a/lib/maps-file-tile-source.c
+++ b/lib/maps-file-tile-source.c
@@ -495,7 +495,7 @@ maps_file_tile_source_prepare (MapsFileTileSource *tile_source,
                                                     tile_size);
   tile_source->priv->world->right = champlain_map_source_get_longitude (source,
                                                      tile_source->priv->min_zoom,
-                                                     tile_source->priv->max_x *
+                                                     (tile_source->priv->max_x + 1) *
                                                      tile_size);
   tile_source->priv->world->top = champlain_map_source_get_latitude (source,
                                                      tile_source->priv->min_zoom,
@@ -503,7 +503,7 @@ maps_file_tile_source_prepare (MapsFileTileSource *tile_source,
                                                      tile_size);
   tile_source->priv->world->bottom = champlain_map_source_get_latitude (source,
                                                   tile_source->priv->min_zoom,
-                                                  tile_source->priv->max_y *
+                                                  (tile_source->priv->max_y + 1) *
                                                   tile_size);
  out:
   return ret;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]