comparison src/pixbuf-renderer.c @ 87:a2b0a7b0b490

Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net> * pixbuf-renderer.c (pixbuf_renderer_scroll): Fix long standing bug where obstructed portions of an image were not always generating an expose event when scrolling the image.
author gqview
date Wed, 25 Oct 2006 19:23:46 +0000
parents 44f2223541d1
children eb9bb29cbd65
comparison
equal deleted inserted replaced
86:cade6a52a165 87:a2b0a7b0b490
2006 x, y, 2006 x, y,
2007 x, y, 2007 x, y,
2008 w, h, 2008 w, h,
2009 pr->dither_quality, it->x + x, it->y + y); 2009 pr->dither_quality, it->x + x, it->y + y);
2010 } 2010 }
2011
2012 #if 0
2013 /* enable this line for debugging the edges of tiles */
2014 gdk_draw_rectangle(it->pixmap, box->style->white_gc,
2015 FALSE, 0, 0, it->w, it->h);
2016 #endif
2011 } 2017 }
2012 2018
2013 2019
2014 static void pr_tile_expose(PixbufRenderer *pr, ImageTile *it, 2020 static void pr_tile_expose(PixbufRenderer *pr, ImageTile *it,
2015 gint x, gint y, gint w, gint h, 2021 gint x, gint y, gint w, gint h,
2777 { 2783 {
2778 gint x1, y1; 2784 gint x1, y1;
2779 gint x2, y2; 2785 gint x2, y2;
2780 GtkWidget *box; 2786 GtkWidget *box;
2781 GdkGC *gc; 2787 GdkGC *gc;
2788 GdkEvent *event;
2782 2789
2783 if (x_off < 0) 2790 if (x_off < 0)
2784 { 2791 {
2785 x1 = abs(x_off); 2792 x1 = abs(x_off);
2786 x2 = 0; 2793 x2 = 0;
2830 { 2837 {
2831 /* FIXME, to optimize this, remove overlap */ 2838 /* FIXME, to optimize this, remove overlap */
2832 pr_queue(pr, 2839 pr_queue(pr,
2833 pr->x_scroll, y_off > 0 ? pr->y_scroll + (pr->vis_height - h) : pr->y_scroll, 2840 pr->x_scroll, y_off > 0 ? pr->y_scroll + (pr->vis_height - h) : pr->y_scroll,
2834 pr->vis_width, h, TRUE, TILE_RENDER_ALL, FALSE, FALSE); 2841 pr->vis_width, h, TRUE, TILE_RENDER_ALL, FALSE, FALSE);
2842 }
2843
2844 /* process exposures here, "expose_event" seems to miss a few with obstructed windows */
2845 while ((event = gdk_event_get_graphics_expose(box->window)) != NULL)
2846 {
2847 pixbuf_renderer_paint(pr, &event->expose.area);
2848
2849 if (event->expose.count == 0)
2850 {
2851 gdk_event_free(event);
2852 break;
2853 }
2854 gdk_event_free(event);
2835 } 2855 }
2836 } 2856 }
2837 } 2857 }
2838 2858
2839 void pixbuf_renderer_scroll_to_point(PixbufRenderer *pr, gint x, gint y, 2859 void pixbuf_renderer_scroll_to_point(PixbufRenderer *pr, gint x, gint y,