summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 87c7536)
raw | patch | inline | side by side (parent: 87c7536)
author | pjrm <pjrm@users.sourceforge.net> | |
Mon, 25 Jun 2007 11:14:35 +0000 (11:14 +0000) | ||
committer | pjrm <pjrm@users.sourceforge.net> | |
Mon, 25 Jun 2007 11:14:35 +0000 (11:14 +0000) |
src/helper/png-write.cpp | patch | blob | history |
index fb428644ceadceeb5461779fd5fa0b804dd94b26..ca8c885590b0d317b124dd55bd06bcf4e49caf6b 100644 (file)
--- a/src/helper/png-write.cpp
+++ b/src/helper/png-write.cpp
#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"
* (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);
/* 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