diff options
author | Thomas White <taw@physics.org> | 2018-01-04 21:30:10 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-01-04 21:30:10 +0100 |
commit | 785c8853383711e6e0bcbdbbcc806907cab391dc (patch) | |
tree | 645a59d3fe4d6b1835be5395cd2b779a01b23f7e /src/narrative_window.c | |
parent | 64d9b0f710e044b148e5ef564dcef5a4d1a07cf1 (diff) |
Get slide size from stylesheet
Diffstat (limited to 'src/narrative_window.c')
-rw-r--r-- | src/narrative_window.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/narrative_window.c b/src/narrative_window.c index 1bf9791..9058403 100644 --- a/src/narrative_window.c +++ b/src/narrative_window.c @@ -632,10 +632,10 @@ static void nw_update_titlebar(NarrativeWindow *nw) static int create_thumbnail(SCInterpreter *scin, SCBlock *bl, double *w, double *h, void **bvp, void *vp) { + struct presentation *p = vp; SCBlock *b; - /* FIXME: Should come from presentation. 320/256 for 4:3 */ - *w = 480.0; + *w = 270.0*(p->slide_width / p->slide_height); *h = 270.0; b = sc_interp_get_macro_real_block(scin); @@ -656,10 +656,10 @@ static cairo_surface_t *render_thumbnail(int w, int h, void *bvp, void *vp) scblocks = sc_block_child(scblocks); stylesheets[0] = p->stylesheet; stylesheets[1] = NULL; + /* FIXME: Cache like crazy here */ - /* FIXME: Get size from presentation. 1024/768 for 4:3 */ - surf = render_sc(scblocks, w, h, 1280.0, 720.0, stylesheets, NULL, - p->is, 0, &top, p->lang); + surf = render_sc(scblocks, w, h, p->slide_width, p->slide_height, + stylesheets, NULL, p->is, 0, &top, p->lang); frame_free(top); return surf; |