diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-08-01 18:10:26 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-08-01 18:10:26 +0000 |
| commit | 28945119489f6af06469312dad4286b27c57c493 (patch) | |
| tree | 997fb2305b3dda5d82452a4d6733793c8fc11bcf /src/live_effects/parameter/pointparam-knotholder.cpp | |
| parent | change knot.h to Geom::Point only instead of NR::Point. (diff) | |
| download | inkscape-28945119489f6af06469312dad4286b27c57c493.tar.gz inkscape-28945119489f6af06469312dad4286b27c57c493.zip | |
replace matrix division code.
(bzr r6512)
Diffstat (limited to 'src/live_effects/parameter/pointparam-knotholder.cpp')
| -rw-r--r-- | src/live_effects/parameter/pointparam-knotholder.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/live_effects/parameter/pointparam-knotholder.cpp b/src/live_effects/parameter/pointparam-knotholder.cpp index 42601c170..434eff4f4 100644 --- a/src/live_effects/parameter/pointparam-knotholder.cpp +++ b/src/live_effects/parameter/pointparam-knotholder.cpp @@ -19,7 +19,6 @@ #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> @@ -92,7 +91,7 @@ PointParamKnotHolder::add_knot ( 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()); |
