]> Pileus Git - grits/commitdiff
Fix queue_draw on grits_tiles
authorAndy Spencer <andy753421@gmail.com>
Wed, 23 Jan 2013 06:29:46 +0000 (06:29 +0000)
committerAndy Spencer <andy753421@gmail.com>
Wed, 23 Jan 2013 06:29:46 +0000 (06:29 +0000)
Any tile other than the top level tile wouldn't queue draw correctly
because it didn't have direct access to the viewer. Just search up until
we find it..

src/objects/grits-tile.c

index e42a1606338d916f0704ff1959e4aece9db7edbe..7d656e5b436c36b9946e1617b287aaef1c475c38 100644 (file)
@@ -246,6 +246,13 @@ void grits_tile_update(GritsTile *tile, GritsPoint *eye,
                                load_func, user_data);
 }
 
                                load_func, user_data);
 }
 
+static void _grits_tile_queue_draw(GritsTile *tile)
+{
+       while (!GRITS_OBJECT(tile)->viewer && tile->parent)
+               tile = tile->parent;
+       grits_object_queue_draw(GRITS_OBJECT(tile));
+}
+
 /**
  * grits_tile_load_pixels:
  * @tile:   the tile to load data into
 /**
  * grits_tile_load_pixels:
  * @tile:   the tile to load data into
@@ -276,7 +283,8 @@ gboolean grits_tile_load_pixels(GritsTile *tile, guchar *pixels,
        tile->pixels = pixels;
 
        /* Queue OpenGL texture load/draw */
        tile->pixels = pixels;
 
        /* Queue OpenGL texture load/draw */
-       grits_object_queue_draw(GRITS_OBJECT(tile));
+       _grits_tile_queue_draw(tile);
+
        return TRUE;
 }
 
        return TRUE;
 }
 
@@ -301,7 +309,7 @@ gboolean grits_tile_load_pixbuf(GritsTile *tile, GdkPixbuf *pixbuf)
        tile->alpha  = gdk_pixbuf_get_has_alpha(pixbuf);
 
        /* Queue OpenGL texture load/draw */
        tile->alpha  = gdk_pixbuf_get_has_alpha(pixbuf);
 
        /* Queue OpenGL texture load/draw */
-       grits_object_queue_draw(GRITS_OBJECT(tile));
+       _grits_tile_queue_draw(tile);
 
        return TRUE;
 }
 
        return TRUE;
 }
@@ -329,7 +337,7 @@ gboolean grits_tile_load_file(GritsTile *tile, const gchar *file)
        tile->alpha  = gdk_pixbuf_get_has_alpha(tile->pixbuf);
 
        /* Queue OpenGL texture load/draw */
        tile->alpha  = gdk_pixbuf_get_has_alpha(tile->pixbuf);
 
        /* Queue OpenGL texture load/draw */
-       grits_object_queue_draw(GRITS_OBJECT(tile));
+       _grits_tile_queue_draw(tile);
 
        return TRUE;
 }
 
        return TRUE;
 }