Lines 2833-2839
void pixbuf_renderer_scroll(PixbufRenderer *pr, gint x, gint y)
Link Here
|
2833 |
{ |
2833 |
{ |
2834 |
gint old_x, old_y; |
2834 |
gint old_x, old_y; |
2835 |
gint x_off, y_off; |
2835 |
gint x_off, y_off; |
2836 |
gint w, h; |
|
|
2837 |
|
2836 |
|
2838 |
g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
2837 |
g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
2839 |
|
2838 |
|
Lines 2853-2942
void pixbuf_renderer_scroll(PixbufRenderer *pr, gint x, gint y)
Link Here
|
2853 |
x_off = pr->x_scroll - old_x; |
2852 |
x_off = pr->x_scroll - old_x; |
2854 |
y_off = pr->y_scroll - old_y; |
2853 |
y_off = pr->y_scroll - old_y; |
2855 |
|
2854 |
|
2856 |
w = pr->vis_width - abs(x_off); |
2855 |
gdk_window_scroll( |
2857 |
h = pr->vis_height - abs(y_off); |
2856 |
gtk_widget_get_window(GTK_WIDGET(pr)), -x_off, -y_off); |
2858 |
|
|
|
2859 |
if (w < 1 || h < 1) |
2860 |
{ |
2861 |
/* scrolled completely to new material */ |
2862 |
pr_queue(pr, 0, 0, pr->width, pr->height, TRUE, TILE_RENDER_ALL, FALSE, FALSE); |
2863 |
return; |
2864 |
} |
2865 |
else |
2866 |
{ |
2867 |
gint x1, y1; |
2868 |
gint x2, y2; |
2869 |
GtkWidget *box; |
2870 |
GdkGC *gc; |
2871 |
GdkEvent *event; |
2872 |
|
2873 |
if (x_off < 0) |
2874 |
{ |
2875 |
x1 = abs(x_off); |
2876 |
x2 = 0; |
2877 |
} |
2878 |
else |
2879 |
{ |
2880 |
x1 = 0; |
2881 |
x2 = abs(x_off); |
2882 |
} |
2883 |
|
2884 |
if (y_off < 0) |
2885 |
{ |
2886 |
y1 = abs(y_off); |
2887 |
y2 = 0; |
2888 |
} |
2889 |
else |
2890 |
{ |
2891 |
y1 = 0; |
2892 |
y2 = abs(y_off); |
2893 |
} |
2894 |
|
2857 |
|
2895 |
box = GTK_WIDGET(pr); |
|
|
2896 |
|
2897 |
gc = gdk_gc_new(box->window); |
2898 |
gdk_gc_set_exposures(gc, TRUE); |
2899 |
gdk_draw_drawable(box->window, gc, |
2900 |
box->window, |
2901 |
x2 + pr->x_offset, y2 + pr->y_offset, |
2902 |
x1 + pr->x_offset, y1 + pr->y_offset, w, h); |
2903 |
g_object_unref(gc); |
2904 |
|
2905 |
if (pr->overlay_list) |
2906 |
{ |
2907 |
pr_overlay_queue_all(pr); |
2908 |
} |
2909 |
|
2910 |
w = pr->vis_width - w; |
2911 |
h = pr->vis_height - h; |
2912 |
|
2913 |
if (w > 0) |
2914 |
{ |
2915 |
pr_queue(pr, |
2916 |
x_off > 0 ? pr->x_scroll + (pr->vis_width - w) : pr->x_scroll, pr->y_scroll, |
2917 |
w, pr->vis_height, TRUE, TILE_RENDER_ALL, FALSE, FALSE); |
2918 |
} |
2919 |
if (h > 0) |
2920 |
{ |
2921 |
/* FIXME, to optimize this, remove overlap */ |
2922 |
pr_queue(pr, |
2923 |
pr->x_scroll, y_off > 0 ? pr->y_scroll + (pr->vis_height - h) : pr->y_scroll, |
2924 |
pr->vis_width, h, TRUE, TILE_RENDER_ALL, FALSE, FALSE); |
2925 |
} |
2926 |
|
2927 |
/* process exposures here, "expose_event" seems to miss a few with obstructed windows */ |
2928 |
while ((event = gdk_event_get_graphics_expose(box->window)) != NULL) |
2929 |
{ |
2930 |
pixbuf_renderer_paint(pr, &event->expose.area); |
2931 |
|
2932 |
if (event->expose.count == 0) |
2933 |
{ |
2934 |
gdk_event_free(event); |
2935 |
break; |
2936 |
} |
2937 |
gdk_event_free(event); |
2938 |
} |
2939 |
} |
2940 |
} |
2858 |
} |
2941 |
|
2859 |
|
2942 |
void pixbuf_renderer_scroll_to_point(PixbufRenderer *pr, gint x, gint y, |
2860 |
void pixbuf_renderer_scroll_to_point(PixbufRenderer *pr, gint x, gint y, |
2943 |
- |
|
|