From fabd3795e9bd75928781374cb12fbe6f1f3f1b6f Mon Sep 17 00:00:00 2001 From: pjrm Date: Mon, 25 Jun 2007 11:14:35 +0000 Subject: [PATCH] noop: (sp_export_png_file): Switch from NRMatrix to NR::Matrix. --- src/helper/png-write.cpp | 13 +++++-------- 1 file 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 #include +#include #include #include #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 -- 2.30.2