summaryrefslogtreecommitdiffstats
path: root/src/helper
diff options
context:
space:
mode:
authorPeter Moulder <peter.moulder@monash.edu>2007-06-25 11:14:35 +0000
committerpjrm <pjrm@users.sourceforge.net>2007-06-25 11:14:35 +0000
commit37cff843dc3a98aaa66395a49fa2f57087ccd895 (patch)
treebea7751dc0c61ba3b3fbd25c4a0ed1c067c6b7f2 /src/helper
parentCodingStyle: whitespace (diff)
downloadinkscape-37cff843dc3a98aaa66395a49fa2f57087ccd895.tar.gz
inkscape-37cff843dc3a98aaa66395a49fa2f57087ccd895.zip
noop: (sp_export_png_file): Switch from NRMatrix to NR::Matrix.
(bzr r3102)
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/png-write.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/helper/png-write.cpp b/src/helper/png-write.cpp
index fb428644c..ca8c88559 100644
--- a/src/helper/png-write.cpp
+++ b/src/helper/png-write.cpp
@@ -18,6 +18,7 @@
#include <interface.h>
#include <libnr/nr-pixops.h>
+#include <libnr/nr-translate-scale-ops.h>
#include <glib/gmessages.h>
#include <png.h>
#include "png-write.h"
@@ -362,13 +363,9 @@ sp_export_png_file(SPDocument *doc, gchar const *filename,
* (2) a[5] = -a[3] * y1
*/
- NRMatrix affine;
- affine.c[0] = width / (x1 - x0);
- affine.c[1] = 0.0;
- affine.c[2] = 0.0;
- affine.c[3] = height / (y1 - y0);
- affine.c[4] = -affine.c[0] * x0;
- affine.c[5] = -affine.c[3] * y0;
+ NR::Matrix const affine(NR::translate(-x0, -y0)
+ * NR::scale(width / (x1 - x0),
+ height / (y1 - y0)));
//SP_PRINT_MATRIX("SVG2PNG", &affine);
@@ -386,7 +383,7 @@ sp_export_png_file(SPDocument *doc, gchar const *filename,
/* Create ArenaItems and set transform */
ebp.root = sp_item_invoke_show(SP_ITEM(sp_document_root(doc)), arena, dkey, SP_ITEM_SHOW_DISPLAY);
- nr_arena_item_set_transform(NR_ARENA_ITEM(ebp.root), NR::Matrix(&affine));
+ nr_arena_item_set_transform(NR_ARENA_ITEM(ebp.root), affine);
// We show all and then hide all items we don't want, instead of showing only requested items,
// because that would not work if the shown item references something in defs