diff options
author | Thomas White <taw@bitwiz.me.uk> | 2019-03-24 13:53:03 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.me.uk> | 2019-03-24 13:53:03 +0100 |
commit | a4a3ad0ee82b0731c540e90c3c137a240acb10f2 (patch) | |
tree | dffca362b77a9893da4971abe7c6045a8cac23e5 /libstorycode/narrative_render_cairo.c | |
parent | f5fd7623a14dd51a59657cbab4d5953b1b2e48ff (diff) |
Implement text selection in slides
Diffstat (limited to 'libstorycode/narrative_render_cairo.c')
-rw-r--r-- | libstorycode/narrative_render_cairo.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libstorycode/narrative_render_cairo.c b/libstorycode/narrative_render_cairo.c index b4f29cb..6da1db1 100644 --- a/libstorycode/narrative_render_cairo.c +++ b/libstorycode/narrative_render_cairo.c @@ -149,10 +149,13 @@ static cairo_surface_t *render_thumbnail(Slide *s, Stylesheet *ss, ImageStore *i PangoContext *pc; const int rh = 1024; /* "reasonably big" height for slide */ int rw; + struct slide_pos sel; slide_get_logical_size(s, ss, &logical_w, &logical_h); rw = rh*(logical_w/logical_h); + sel.para = 0; sel.pos = 0; sel.trail = 0; + /* Render at a reasonably big size. Rendering to a small surface makes * rounding of text positions (due to font hinting) cause significant * differences between the thumbnail and "normal" rendering. */ @@ -160,7 +163,8 @@ static cairo_surface_t *render_thumbnail(Slide *s, Stylesheet *ss, ImageStore *i cr = cairo_create(full_surf); cairo_scale(cr, (double)rw/logical_w, (double)rh/logical_h); pc = pango_cairo_create_context(cr); - slide_render_cairo(s, cr, is, ss, 0, pango_language_get_default(), pc); + slide_render_cairo(s, cr, is, ss, 0, pango_language_get_default(), pc, + NULL, sel, sel); g_object_unref(pc); cairo_destroy(cr); |