diff options
author | Thomas White <taw@bitwiz.me.uk> | 2020-01-13 00:04:34 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.me.uk> | 2020-01-13 00:04:34 +0100 |
commit | 956d397b8d34ba79fc7486f609a22ba80216384f (patch) | |
tree | 82639f9461ee261a379be208c101823e937e71bd | |
parent | b6371bd23520160e7460fdda13994ae9bc9ab4ab (diff) |
Generalise draw_marker()
-rw-r--r-- | libstorycode/narrative_render_cairo.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libstorycode/narrative_render_cairo.c b/libstorycode/narrative_render_cairo.c index 663c9e2..68531c9 100644 --- a/libstorycode/narrative_render_cairo.c +++ b/libstorycode/narrative_render_cairo.c @@ -400,7 +400,8 @@ static void draw_slide(struct narrative_item *item, cairo_t *cr) } -static void draw_marker(struct narrative_item *item, cairo_t *cr) +static void draw_marker(struct narrative_item *item, cairo_t *cr, + double r, double g, double b, char *text) { double x, y; PangoLayout *layout; @@ -421,11 +422,11 @@ static void draw_marker(struct narrative_item *item, cairo_t *cr) } cairo_rectangle(cr, x, y, item->obj_w, item->obj_h); - cairo_set_source_rgb(cr, 0.8, 0.0, 0.0); + cairo_set_source_rgb(cr, r, g, b); cairo_fill(cr); layout = pango_cairo_create_layout(cr); - pango_layout_set_text(layout, _("End of presentation"), -1); + pango_layout_set_text(layout, text, -1); fontdesc = pango_font_description_new(); pango_font_description_set_family_static(fontdesc, "Sans"); @@ -482,7 +483,8 @@ int narrative_render_item_cairo(Narrative*n, cairo_t *cr, int i) break; case NARRATIVE_ITEM_EOP : - draw_marker(&n->items[i], cr); + draw_marker(&n->items[i], cr, 0.8, 0.0, 0.0, + _("End of presentation")); break; } |