[perl-Gnome2-Rsvg] Use the correct image size in the example
- From: Torsten Schönfeld <tsch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-Gnome2-Rsvg] Use the correct image size in the example
- Date: Mon, 17 May 2010 21:59:27 +0000 (UTC)
commit af6014a798d81275e50974c5942f037ae17f1cd5
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date: Mon May 17 23:57:21 2010 +0200
Use the correct image size in the example
examples/render-to-cairo.pl | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/examples/render-to-cairo.pl b/examples/render-to-cairo.pl
index f596288..37d0573 100644
--- a/examples/render-to-cairo.pl
+++ b/examples/render-to-cairo.pl
@@ -11,8 +11,10 @@ while (<SVG>) {
close(SVG);
$handle -> close() or die("Could not parse '$svg'");
-# FIXME: Use get_dimensions() once available.
-my $surface = Cairo::ImageSurface -> create("argb32", 100, 100);
+my $dim = $handle -> get_dimensions();
+my $surface = Cairo::ImageSurface -> create("argb32",
+ $dim->{width},
+ $dim->{height});
my $cr = Cairo::Context -> create($surface);
$handle -> render_cairo($cr);
$surface -> write_to_png(basename($svg) . '.png');
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]