[librsvg/librsvg-2.48] rsvg-convert: apply scale once, not again on each output page
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/librsvg-2.48] rsvg-convert: apply scale once, not again on each output page
- Date: Thu, 13 Feb 2020 16:00:24 +0000 (UTC)
commit 0ccf4511b990bf25b733c07f3a25bd4e82f69795
Author: Sven Neumann <sven svenfoo org>
Date: Wed Feb 12 15:30:06 2020 +0100
rsvg-convert: apply scale once, not again on each output page
Fixes zoom option for multi-page PDF output (#240).
rsvg-convert.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/rsvg-convert.c b/rsvg-convert.c
index f57706e0..328059af 100644
--- a/rsvg-convert.c
+++ b/rsvg-convert.c
@@ -560,6 +560,9 @@ main (int argc, char **argv)
}
cr = cairo_create (surface);
+ cairo_scale (cr,
+ scaled_width / unscaled_width,
+ scaled_height / unscaled_height);
}
// Set background color
@@ -579,14 +582,10 @@ main (int argc, char **argv)
((background_color >> 16) & 0xff) / 255.0,
((background_color >> 8) & 0xff) / 255.0,
((background_color >> 0) & 0xff) / 255.0);
- cairo_rectangle (cr, 0, 0, scaled_width, scaled_height);
+ cairo_rectangle (cr, 0, 0, unscaled_width, unscaled_height);
cairo_fill (cr);
}
- cairo_scale (cr,
- scaled_width / unscaled_width,
- scaled_height / unscaled_height);
-
if (export_lookup_id) {
RsvgPositionData pos;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]