summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann <sandmann@redhat.com>2008-06-08 02:22:42 -0400
committerSøren Sandmann <sandmann@redhat.com>2008-06-08 02:22:42 -0400
commitf422e236a0a65ce52a39f26729cc6fa8840d8dc4 (patch)
treed3c3ff94ff1c97aac68a7eea05e34fd4dd38b42b
parente8f3b2eafc8d73b90cc50895972ea91d57ca329c (diff)
Add more parameters to deck_paint
-rw-r--r--deck.c14
-rw-r--r--deck.h5
-rw-r--r--main.c9
3 files changed, 19 insertions, 9 deletions
diff --git a/deck.c b/deck.c
index 71cde5b..05aea15 100644
--- a/deck.c
+++ b/deck.c
@@ -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);
diff --git a/deck.h b/deck.h
index ee6ec9d..57c5aa2 100644
--- a/deck.h
+++ b/deck.h
@@ -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.
diff --git a/main.c b/main.c
index bd147c6..4af5269 100644
--- a/main.c
+++ b/main.c
@@ -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);