[libshumate] map-layer: Fix bug in tile grid update



commit e6aab645603426a6b64562129c556091303a962a
Author: James Westman <james jwestman net>
Date:   Sat Feb 27 21:46:02 2021 -0600

    map-layer: Fix bug in tile grid update
    
    The function to upgrade the tile grid conflated tile coordinates with
    its own internal grid coordinates. This sometimes caused tiles not to be
    updated when they should, and it caused very many unnecessary tile
    updates.
    
    Fixes #14.

 shumate/shumate-map-layer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/shumate/shumate-map-layer.c b/shumate/shumate-map-layer.c
index 9ce6c42..e6d8659 100644
--- a/shumate/shumate-map-layer.c
+++ b/shumate/shumate-map-layer.c
@@ -150,8 +150,8 @@ shumate_map_layer_compute_grid (ShumateMapLayer *self)
               gtk_widget_measure (GTK_WIDGET (child), GTK_ORIENTATION_HORIZONTAL, 0, NULL, NULL, NULL, NULL);
               gtk_widget_size_allocate (GTK_WIDGET (child), &child_allocation, -1);
               if (shumate_tile_get_zoom_level (child) != zoom_level ||
-                  shumate_tile_get_x (child) != x ||
-                  shumate_tile_get_y (child) != y ||
+                  shumate_tile_get_x (child) != (tile_x % source_columns) ||
+                  shumate_tile_get_y (child) != (tile_y % source_rows) ||
                   shumate_tile_get_state (child) == SHUMATE_STATE_NONE)
                 {
                   GCancellable *cancellable = g_hash_table_lookup (self->tile_fill, child);


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