summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 41cb516)
raw | patch | inline | side by side (parent: 41cb516)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Fri, 1 Aug 2008 18:10:26 +0000 (18:10 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Fri, 1 Aug 2008 18:10:26 +0000 (18:10 +0000) |
diff --git a/src/desktop.cpp b/src/desktop.cpp
index 0a7f353a88daed5c50d75794dd670aaeee37aa52..b8d9ef0b036543f9b929af206ff3dce7bc1a0b4c 100644 (file)
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
#include "display/sp-canvas-util.h"
#include "display/canvas-temporary-item-list.h"
#include "display/snap-indicator.h"
-#include "libnr/nr-matrix-div.h"
#include "libnr/nr-rect-ops.h"
#include "ui/dialog/dialog-manager.h"
#include "xml/repr.h"
NR::Point SPDesktop::dt2doc(NR::Point const &p) const
{
- return p / _doc2dt;
+ return p * _doc2dt.inverse();
}
index 28d4b0c6902b1cfac7d8d6d7d0898d41d761d8f2..9be8d5844d41a238f0d1cc89f63524e4a59f2ace 100644 (file)
*/
-#include "libnr/nr-matrix-div.h"
+#include "libnr/nr-matrix-ops.h"
#include "libnr/nr-pixops.h"
#include "sp-canvas-util.h"
#include <string.h> /* for memset */
g_assert (from != NULL);
g_assert (to != NULL);
- return sp_canvas_item_i2w_affine(from) / sp_canvas_item_i2w_affine(to);
+ return sp_canvas_item_i2w_affine(from) * sp_canvas_item_i2w_affine(to).inverse();
}
void sp_canvas_item_set_i2w_affine (SPCanvasItem * item, NR::Matrix const &i2w)
{
g_assert (item != NULL);
- sp_canvas_item_affine_absolute(item, i2w / sp_canvas_item_i2w_affine(item->parent));
+ sp_canvas_item_affine_absolute(item, i2w * sp_canvas_item_i2w_affine(item->parent).inverse());
}
void sp_canvas_item_move_to_z (SPCanvasItem * item, gint z)
diff --git a/src/knotholder.cpp b/src/knotholder.cpp
index 629aa73684a3924d3202912261a7bf929631dc24..f4892b008c5a4892b1c2d4f9c91cc1ce33b5b1d6 100644 (file)
--- a/src/knotholder.cpp
+++ b/src/knotholder.cpp
#include "xml/repr.h" // for debugging only
-#include <libnr/nr-matrix-div.h>
#include <glibmm/i18n.h>
class SPDesktop;
for(std::list<KnotHolderEntity *>::iterator i = this->entity.begin(); i != this->entity.end(); ++i) {
KnotHolderEntity *e = *i;
if (e->knot == knot) {
- NR::Point const q = p / from_2geom(sp_item_i2d_affine(item));
- e->knot_set(q, e->knot->drag_origin / from_2geom(sp_item_i2d_affine(item)), state);
+ NR::Point const q = p * sp_item_i2d_affine(item).inverse();
+ e->knot_set(q, e->knot->drag_origin * sp_item_i2d_affine(item).inverse(), state);
break;
}
}
diff --git a/src/live_effects/parameter/pointparam-knotholder.cpp b/src/live_effects/parameter/pointparam-knotholder.cpp
index 42601c170b8fa27f8130085bfe84560007e9bc8d..434eff4f4e574818b9f93585265bfc69f5309170 100644 (file)
#include "knotholder.h"
#include "knot-holder-entity.h"
-#include <libnr/nr-matrix-div.h>
#include <glibmm/i18n.h>
#include <2geom/point.h>
#include <2geom/matrix.h>
entity.push_back(e);
// Move to current point.
- NR::Point dp = p * from_2geom(sp_item_i2d_affine(item));
+ Geom::Point dp = p * sp_item_i2d_affine(item);
sp_knot_set_position(e->knot, dp, SP_KNOT_STATE_NORMAL);
e->handler_id = g_signal_connect(e->knot, "moved", G_CALLBACK(pointparam_knot_moved_handler), this);
@@ -113,22 +112,22 @@ static void pointparam_knot_clicked_handler(SPKnot */*knot*/, guint /*state*/, P
*/
static void pointparam_knot_moved_handler(SPKnot */*knot*/, NR::Point const *p, guint /*state*/, PointParamKnotHolder *kh)
{
- NR::Matrix const i2d(from_2geom(sp_item_i2d_affine(kh->getItem())));
- NR::Point pos = (*p) / i2d;
+ Geom::Matrix const i2d(sp_item_i2d_affine(kh->getItem()));
+ Geom::Point pos = (*p) * i2d.inverse();
Inkscape::SVGOStringStream os;
- os << pos.to_2geom();
+ os << pos;
kh->lpeobject->lpe->setParameter(kh->repr_key, os.str().c_str());
}
static void pointparam_knot_ungrabbed_handler(SPKnot *knot, unsigned int /*state*/, PointParamKnotHolder *kh)
{
- NR::Matrix const i2d(from_2geom(sp_item_i2d_affine(kh->getItem())));
- NR::Point pos = sp_knot_position(knot) / i2d;
+ Geom::Matrix const i2d(sp_item_i2d_affine(kh->getItem()));
+ Geom::Point pos = sp_knot_position(knot) * i2d.inverse();
Inkscape::SVGOStringStream os;
- os << pos.to_2geom();
+ os << pos;
kh->repr->setAttribute(kh->repr_key , os.str().c_str());
diff --git a/src/object-edit.cpp b/src/object-edit.cpp
index ea0291159bfd896ad9bb4224a5ed4b66f1ee37e0..1d72b9b29d1ad27054e792c8c64854d99be3811f 100644 (file)
--- a/src/object-edit.cpp
+++ b/src/object-edit.cpp
#include "object-edit.h"
#include <libnr/nr-scale-ops.h>
-#include <libnr/nr-matrix-div.h>
#include "xml/repr.h"
diff --git a/src/sp-conn-end.cpp b/src/sp-conn-end.cpp
index 80ecb060f23704ff292382c080b45a00bc35d72e..a4ecf1f65917fd34560998908f5b91ad06954c8d 100644 (file)
--- a/src/sp-conn-end.cpp
+++ b/src/sp-conn-end.cpp
#include <string>
#include "display/curve.h"
-#include "libnr/nr-matrix-div.h"
#include "libnr/nr-matrix-fns.h"
#include "xml/repr.h"
#include "sp-conn-end.h"
NR::Point h2endPt_pcoordsys[2];
for (unsigned h = 0; h < 2; ++h) {
h2endPt_icoordsys[h] = calc_bbox_conn_pt(h2bbox_icoordsys[h],
- ( last_seg_endPt[h] / h2i2anc[h] ));
- h2endPt_pcoordsys[h] = h2endPt_icoordsys[h] * h2i2anc[h] / path2anc;
+ ( last_seg_endPt[h] * h2i2anc[h].inverse() ));
+ h2endPt_pcoordsys[h] = h2endPt_icoordsys[h] * h2i2anc[h] * path2anc.inverse();
}
change_endpts(path->curve, h2endPt_pcoordsys);
} else {
// on the edge of the bbox.
NR::Point h2endPt_pcoordsys[2];
h2endPt_icoordsys[ind] = calc_bbox_conn_pt(h2bbox_icoordsys[ind],
- ( last_seg_pt / h2i2anc ));
- h2endPt_pcoordsys[ind] = h2endPt_icoordsys[ind] * h2i2anc / path2anc;
+ ( last_seg_pt * h2i2anc.inverse() ));
+ h2endPt_pcoordsys[ind] = h2endPt_icoordsys[ind] * h2i2anc * path2anc.inverse();
// Leave the other where it is.
h2endPt_pcoordsys[!ind] = other_endpt;
diff --git a/src/sp-gradient.cpp b/src/sp-gradient.cpp
index 82724303fcf03e12769f933342ad20239a169dfc..1fe0d221837195a6e7ccbcb661545c77e9b3078c 100644 (file)
--- a/src/sp-gradient.cpp
+++ b/src/sp-gradient.cpp
#include <cstring>
#include <string>
-#include <libnr/nr-matrix-div.h>
#include <libnr/nr-matrix-fns.h>
#include <libnr/nr-matrix-ops.h>
#include <libnr/nr-matrix-scale-ops.h>
sp_gradient_set_gs2d_matrix(SPGradient *gr, NR::Matrix const &ctm,
NR::Rect const &bbox, NR::Matrix const &gs2d)
{
- gr->gradientTransform = gs2d / ctm;
+ gr->gradientTransform = gs2d * ctm.inverse();
if (gr->units == SP_GRADIENT_UNITS_OBJECTBOUNDINGBOX ) {
gr->gradientTransform = ( gr->gradientTransform
/ NR::translate(bbox.min())
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index c888bc195eaf99009e415bc6116bc6a4f646614e..422ea1195c455023f9aae0959cb2a93bbb1be63b 100644 (file)
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
#include "filter-chemistry.h"
#include "sp-guide.h"
-#include "libnr/nr-matrix-div.h"
#include "libnr/nr-matrix-fns.h"
#include "libnr/nr-matrix-scale-ops.h"
#include "libnr/nr-matrix-translate-ops.h"
i2i_affine(SPObject const *src, SPObject const *dest) {
g_return_val_if_fail(src != NULL && dest != NULL, Geom::identity());
SPObject const *ancestor = src->nearestCommonAncestor(dest);
- return to_2geom( from_2geom(i2anc_affine(src, ancestor)) / from_2geom(i2anc_affine(dest, ancestor)) );
+ return i2anc_affine(src, ancestor) * i2anc_affine(dest, ancestor).inverse();
}
NR::Matrix SPItem::getRelativeTransform(SPObject const *dest) const {
diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp
index e5ffa8b396a16f8ed1c74a11a60b7f090370894a..ad8ba38a93cac607d3c8f1c734405aae8c3e25c1 100644 (file)
--- a/src/sp-rect.cpp
+++ b/src/sp-rect.cpp
#include <display/curve.h>
-#include <libnr/nr-matrix-div.h>
+#include <libnr/nr-matrix-ops.h>
#include <libnr/nr-matrix-fns.h>
#include "inkscape.h"
sp_item_adjust_stroke(item, sqrt(fabs(sw * sh)));
// Adjust pattern fill
- sp_item_adjust_pattern(item, xform / ret);
+ sp_item_adjust_pattern(item, xform * ret.inverse());
// Adjust gradient fill
- sp_item_adjust_gradient(item, xform / ret);
+ sp_item_adjust_gradient(item, xform * ret.inverse());
item->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG);