diff options
author | Søren Sandmann <sandmann@redhat.com> | 2008-06-08 02:22:42 -0400 |
---|---|---|
committer | Søren Sandmann <sandmann@redhat.com> | 2008-06-08 02:22:42 -0400 |
commit | f422e236a0a65ce52a39f26729cc6fa8840d8dc4 (patch) | |
tree | d3c3ff94ff1c97aac68a7eea05e34fd4dd38b42b | |
parent | e8f3b2eafc8d73b90cc50895972ea91d57ca329c (diff) |
Add more parameters to deck_paint
-rw-r--r-- | deck.c | 14 | ||||
-rw-r--r-- | deck.h | 5 | ||||
-rw-r--r-- | main.c | 9 |
3 files changed, 19 insertions, 9 deletions
@@ -32,7 +32,10 @@ deck_get_slide_height (Deck *deck, void deck_paint (Deck *deck, FooScrollArea *area, - cairo_t *cr) + cairo_t *cr, + int orig_x, + int orig_y, + int width) { int height; int i; @@ -41,14 +44,15 @@ deck_paint (Deck *deck, foo_scroll_area_get_viewport (area, &viewport); height = deck_get_slide_height (deck, &viewport); + + width -= 2 * MARGIN; for (i = 0; i < N_SLIDES; ++i) { - double x, y, width; + double x, y; - x = MARGIN; - y = MARGIN + i * (MARGIN + height); - width = viewport.width - 2 * MARGIN; + x = orig_x + MARGIN; + y = orig_y + MARGIN + i * (MARGIN + height); cairo_set_source_rgba (cr, 1, 1, 1, 1); @@ -9,7 +9,10 @@ Deck *deck_new (DeckChangeNotify notify, gpointer data); void deck_paint (Deck *deck, FooScrollArea *area, - cairo_t *cr); + cairo_t *cr, + int x, + int y, + int width); /* Returns the slide the user is likely looking * at, given the viewport. @@ -34,14 +34,17 @@ get_widget (App *app, const char *name) static void on_thumbs_paint (FooScrollArea *scroll_area, - cairo_t *cr, + cairo_t *cr, GdkRectangle *extents, GdkRegion *region, gpointer data) { App *app = data; + GdkRectangle viewport; - deck_paint (app->deck, scroll_area, cr); + foo_scroll_area_get_viewport (app->thumbnails, &viewport); + + deck_paint (app->deck, scroll_area, cr, 0, 0, viewport.width); } static void @@ -103,7 +106,7 @@ on_main_paint (FooScrollArea *scroll_area, cairo_save (cr); - deck_paint (app->deck, scroll_area, cr); + deck_paint (app->deck, scroll_area, cr, 0, 0, viewport.width); paint_toolbar (app, scroll_area, cr); cairo_restore (cr); |