summaryrefslogtreecommitdiffstats
path: root/src/libnr
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-08-06 22:32:41 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-08-06 22:32:41 +0000
commit9223141ae17fef459e79f98829b88ae26846ef09 (patch)
treeac62c3bac992bd4e2cd719eddf316a1d47a918da /src/libnr
parent1) When pasting, use an offset that is a multiple of the grid pitch (got lost... (diff)
downloadinkscape-9223141ae17fef459e79f98829b88ae26846ef09.tar.gz
inkscape-9223141ae17fef459e79f98829b88ae26846ef09.zip
add automatic conversion between Geom::Matrix and NR::Matrix. (added to NR::Matrix class). resolved some ambiguities caused by it.
(bzr r6581)
Diffstat (limited to 'src/libnr')
-rw-r--r--src/libnr/nr-matrix.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libnr/nr-matrix.h b/src/libnr/nr-matrix.h
index f626377e5..b1f9d589a 100644
--- a/src/libnr/nr-matrix.h
+++ b/src/libnr/nr-matrix.h
@@ -25,6 +25,7 @@
#include <libnr/nr-rotate.h>
#include <libnr/nr-scale.h>
#include <libnr/nr-translate.h>
+#include <2geom/matrix.h>
namespace NR {
@@ -77,6 +78,16 @@ class Matrix {
}
+ Matrix(Geom::Matrix const &m) {
+ NR::Coord *dest = _c;
+
+ *dest++ = m[0];
+ *dest++ = m[1];
+ *dest++ = m[2];
+ *dest++ = m[3];
+ *dest++ = m[4];
+ *dest = m[5];
+ }
/**
*
@@ -220,6 +231,9 @@ class Matrix {
return _c[i];
}
+ inline operator Geom::Matrix() const {
+ return Geom::Matrix(_c[0], _c[1], _c[2], _c[3], _c[4], _c[5]);
+ }
/**
*