From 6793e7a7f7752e8924c40c0e0c99e857350d7356 Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Wed, 23 Jan 2013 06:29:46 +0000 Subject: [PATCH] Fix queue_draw on grits_tiles 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 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/objects/grits-tile.c b/src/objects/grits-tile.c index e42a160..7d656e5 100644 --- a/src/objects/grits-tile.c +++ b/src/objects/grits-tile.c @@ -246,6 +246,13 @@ void grits_tile_update(GritsTile *tile, GritsPoint *eye, 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 @@ -276,7 +283,8 @@ gboolean grits_tile_load_pixels(GritsTile *tile, guchar *pixels, tile->pixels = pixels; /* Queue OpenGL texture load/draw */ - grits_object_queue_draw(GRITS_OBJECT(tile)); + _grits_tile_queue_draw(tile); + 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 */ - grits_object_queue_draw(GRITS_OBJECT(tile)); + _grits_tile_queue_draw(tile); 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 */ - grits_object_queue_draw(GRITS_OBJECT(tile)); + _grits_tile_queue_draw(tile); return TRUE; } -- 2.43.2