summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-tangent_to_curve.cpp
diff options
context:
space:
mode:
authorLiam P. White <inkscapebronyat-signgmaildotcom>2014-04-06 21:38:30 +0000
committerLiam P. White <inkscapebronyat-signgmaildotcom>2014-04-06 21:38:30 +0000
commit6f10c7f675fae8c20f24f01b7cffb861f3726e9d (patch)
treea78b993f14603288e71637bb22f7a2929c8ba5bf /src/live_effects/lpe-tangent_to_curve.cpp
parentPrevent crash on "three knot" issue (diff)
downloadinkscape-6f10c7f675fae8c20f24f01b7cffb861f3726e9d.tar.gz
inkscape-6f10c7f675fae8c20f24f01b7cffb861f3726e9d.zip
Properly allow effect stacking with knotholders (and add extra LPE functionality)
(bzr r13090.1.48)
Diffstat (limited to 'src/live_effects/lpe-tangent_to_curve.cpp')
-rw-r--r--src/live_effects/lpe-tangent_to_curve.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/live_effects/lpe-tangent_to_curve.cpp b/src/live_effects/lpe-tangent_to_curve.cpp
index dbebdf7fb..bce4876af 100644
--- a/src/live_effects/lpe-tangent_to_curve.cpp
+++ b/src/live_effects/lpe-tangent_to_curve.cpp
@@ -16,8 +16,6 @@
#include <glibmm/i18n.h>
#include "live_effects/lpe-tangent_to_curve.h"
-// FIXME: The following are only needed to convert the path's SPCurve* to pwd2.
-// There must be a more convenient way to achieve this.
#include "sp-path.h"
#include "display/curve.h"
@@ -108,13 +106,13 @@ LPETangentToCurve::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desk
{
KnotHolderEntity *e = new TtC::KnotHolderEntityLeftEnd(this);
e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN,
- _("Adjust the \"left\" end of the tangent") );
+ _("Adjust the <b>left</b> end of the tangent") );
knotholder->add(e);
}
{
KnotHolderEntity *e = new TtC::KnotHolderEntityRightEnd(this);
e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN,
- _("Adjust the \"right\" end of the tangent") );
+ _("Adjust the <b>right</b> end of the tangent") );
knotholder->add(e);
}
};
@@ -130,14 +128,13 @@ KnotHolderEntityAttachPt::knot_set(Geom::Point const &p, Geom::Point const &/*or
Geom::Point const s = snap_knot_position(p, state);
- // FIXME: There must be a better way of converting the path's SPCurve* to pwd2.
- SPCurve *curve = SP_PATH(item)->get_curve_for_edit();
- Geom::PathVector pathv = curve->get_pathvector();
- Piecewise<D2<SBasis> > pwd2;
- for (unsigned int i=0; i < pathv.size(); i++) {
- pwd2.concat(pathv[i].toPwSb());
+ if ( !SP_IS_SHAPE(lpe->sp_lpe_item) ) {
+ //lpe->t_attach.param_set_value(0);
+ g_warning("LPEItem is not a path! %s:%d\n", __FILE__, __LINE__);
+ return;
}
-
+ Piecewise<D2<SBasis> > pwd2 = paths_to_pw( lpe->pathvector_before_effect );
+
double t0 = nearest_point(s, pwd2);
lpe->t_attach.param_set_value(t0);