summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0fc2f67)
raw | patch | inline | side by side (parent: 0fc2f67)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Wed, 6 Aug 2008 22:32:41 +0000 (22:32 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Wed, 6 Aug 2008 22:32:41 +0000 (22:32 +0000) |
src/libnr/nr-matrix.h | patch | blob | history | |
src/object-edit.cpp | patch | blob | history |
diff --git a/src/libnr/nr-matrix.h b/src/libnr/nr-matrix.h
index f626377e50a2e2f9e0c6f15b24ef5117210e8e83..b1f9d589ac02679fa58f5cd0ee7f239a02264d99 100644 (file)
--- a/src/libnr/nr-matrix.h
+++ b/src/libnr/nr-matrix.h
#include <libnr/nr-rotate.h>
#include <libnr/nr-scale.h>
#include <libnr/nr-translate.h>
+#include <2geom/matrix.h>
namespace NR {
}
+ 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];
+ }
/**
*
return _c[i];
}
+ inline operator Geom::Matrix() const {
+ return Geom::Matrix(_c[0], _c[1], _c[2], _c[3], _c[4], _c[5]);
+ }
/**
*
diff --git a/src/object-edit.cpp b/src/object-edit.cpp
index 3b513fe8815354593b4a91c39f4985e69a5f47e8..400354d4ab55a14f9f9b850de12fe01cb42b7737 100644 (file)
--- a/src/object-edit.cpp
+++ b/src/object-edit.cpp
@@ -452,7 +452,7 @@ Box3DKnotHolderEntity::knot_set_generic(SPItem *item, unsigned int knot_id, Geom
g_assert(item != NULL);
SPBox3D *box = SP_BOX3D(item);
- NR::Matrix const i2d (from_2geom(sp_item_i2d_affine (item)));
+ Geom::Matrix const i2d (sp_item_i2d_affine (item));
Box3D::Axis movement;
if ((knot_id < 4) != (state & GDK_SHIFT_MASK)) {
@@ -628,7 +628,7 @@ Box3DKnotHolderEntityCenter::knot_set(Geom::Point const &new_pos, Geom::Point co
Geom::Point const s = snap_knot_position(new_pos);
SPBox3D *box = SP_BOX3D(item);
- NR::Matrix const i2d (from_2geom(sp_item_i2d_affine (item)));
+ Geom::Matrix const i2d (sp_item_i2d_affine (item));
box3d_set_center (SP_BOX3D(item), s * i2d, origin * i2d, !(state & GDK_SHIFT_MASK) ? Box3D::XY : Box3D::Z,
state & GDK_CONTROL_MASK);