diff options
author | Thomas White <taw@bitwiz.org.uk> | 2014-09-18 22:58:58 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2014-09-18 22:58:58 +0200 |
commit | 2112709182f800d70ff2dc8374fcb337bcc89f27 (patch) | |
tree | c4d0da0c4f025e5a55d0d78b64cc6b009f2ae987 | |
parent | ec4f394db8d6b74da01fa98a24a4e111f06b223d (diff) |
Fix edit slide rendering size
-rw-r--r-- | src/mainwindow.c | 6 | ||||
-rw-r--r-- | src/render.c | 9 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/mainwindow.c b/src/mainwindow.c index 22e4ce8..b9c9823 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -978,6 +978,7 @@ static gboolean draw_sig(GtkWidget *da, cairo_t *cr, { double xoff, yoff; int width, height; + int edit_slide_height; width = gtk_widget_get_allocated_width(GTK_WIDGET(da)); height = gtk_widget_get_allocated_height(GTK_WIDGET(da)); @@ -992,8 +993,9 @@ static gboolean draw_sig(GtkWidget *da, cairo_t *cr, cairo_fill(cr); /* Get the overall size */ - xoff = (width - p->slide_width)/2.0; - yoff = (height - p->slide_height)/2.0; + edit_slide_height = (p->slide_height/p->slide_width)*p->edit_slide_width; + xoff = (width - p->edit_slide_width)/2.0; + yoff = (height - edit_slide_height)/2.0; p->border_offs_x = xoff; p->border_offs_y = yoff; /* Draw the slide from the cache */ diff --git a/src/render.c b/src/render.c index f42d2cc..db41402 100644 --- a/src/render.c +++ b/src/render.c @@ -327,7 +327,7 @@ void free_render_buffers_except_thumb(struct slide *s) static void render_slide_to_surface(struct slide *s, cairo_surface_t *surf, cairo_t *cr, enum is_size isz, - double scale, double w, double h, + double scale, ImageStore *is, int slide_number) { PangoFontMap *fontmap; @@ -337,7 +337,8 @@ static void render_slide_to_surface(struct slide *s, cairo_surface_t *surf, cairo_scale(cr, scale, scale); - cairo_rectangle(cr, 0.0, 0.0, w, h); + cairo_rectangle(cr, 0.0, 0.0, + s->parent->slide_width, s->parent->slide_height); cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); cairo_fill(cr); @@ -402,7 +403,7 @@ cairo_surface_t *render_slide(struct slide *s, int w, double ww, double hh, surf = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, w, h); cr = cairo_create(surf); - render_slide_to_surface(s, surf, cr, isz, scale, w, h, is, + render_slide_to_surface(s, surf, cr, isz, scale, is, slide_number); cairo_destroy(cr); return surf; @@ -447,7 +448,7 @@ int export_pdf(struct presentation *p, const char *filename) s->top->h = w*r; render_slide_to_surface(s, surf, cr, ISZ_SLIDESHOW, scale, - w, w*r, p->is, i); + p->is, i); cairo_restore(cr); |