summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-bspline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/live_effects/lpe-bspline.cpp')
-rw-r--r--src/live_effects/lpe-bspline.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/live_effects/lpe-bspline.cpp b/src/live_effects/lpe-bspline.cpp
index ecbfef76a..c2a2d080e 100644
--- a/src/live_effects/lpe-bspline.cpp
+++ b/src/live_effects/lpe-bspline.cpp
@@ -9,6 +9,7 @@
#include "sp-path.h"
#include "svg/svg.h"
#include "xml/repr.h"
+#include "preferences.h"
// TODO due to internal breakage in glibmm headers, this must be last:
#include <glibmm/i18n.h>
@@ -43,7 +44,7 @@ LPEBSpline::LPEBSpline(LivePathEffectObject *lpeobject)
steps.param_set_digits(0);
helper_size.param_set_range(0.0, 999.0);
- helper_size.param_set_increments(5, 5);
+ helper_size.param_set_increments(1, 1);
helper_size.param_set_digits(2);
}
@@ -76,13 +77,15 @@ void LPEBSpline::doEffect(SPCurve *curve)
Geom::PathVector const original_pathv = curve->get_pathvector();
curve->reset();
-
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
for (Geom::PathVector::const_iterator path_it = original_pathv.begin();
path_it != original_pathv.end(); ++path_it) {
if (path_it->empty()) {
continue;
}
- hp.push_back(*path_it);
+ if (!prefs->getBool("/tools/nodes/show_outline", true)){
+ hp.push_back(*path_it);
+ }
Geom::Path::const_iterator curve_it1 = path_it->begin();
Geom::Path::const_iterator curve_it2 = ++(path_it->begin());
Geom::Path::const_iterator curve_endit = path_it->end_default();
@@ -121,12 +124,12 @@ void LPEBSpline::doEffect(SPCurve *curve)
if(are_near((*cubic)[1],(*cubic)[0]) && !are_near((*cubic)[2],(*cubic)[3])) {
point_at1 = sbasis_in.valueAt(DEFAULT_START_POWER);
} else {
- point_at1 = sbasis_in.valueAt(Geom::nearest_point((*cubic)[1], *in->first_segment()));
+ point_at1 = sbasis_in.valueAt(Geom::nearest_time((*cubic)[1], *in->first_segment()));
}
if(are_near((*cubic)[2],(*cubic)[3]) && !are_near((*cubic)[1],(*cubic)[0])) {
point_at2 = sbasis_in.valueAt(DEFAULT_END_POWER);
} else {
- point_at2 = sbasis_in.valueAt(Geom::nearest_point((*cubic)[2], *in->first_segment()));
+ point_at2 = sbasis_in.valueAt(Geom::nearest_time((*cubic)[2], *in->first_segment()));
}
} else {
point_at1 = in->first_segment()->initialPoint();
@@ -144,7 +147,7 @@ void LPEBSpline::doEffect(SPCurve *curve)
if(are_near((*cubic)[1],(*cubic)[0]) && !are_near((*cubic)[2],(*cubic)[3])) {
next_point_at1 = sbasis_in.valueAt(DEFAULT_START_POWER);
} else {
- next_point_at1 = sbasis_out.valueAt(Geom::nearest_point((*cubic)[1], *out->first_segment()));
+ next_point_at1 = sbasis_out.valueAt(Geom::nearest_time((*cubic)[1], *out->first_segment()));
}
} else {
next_point_at1 = out->first_segment()->initialPoint();
@@ -161,7 +164,7 @@ void LPEBSpline::doEffect(SPCurve *curve)
cubic = dynamic_cast<Geom::CubicBezier const *>(&*path_it->begin());
if (cubic) {
line_helper->moveto(sbasis_start.valueAt(
- Geom::nearest_point((*cubic)[1], *start->first_segment())));
+ Geom::nearest_time((*cubic)[1], *start->first_segment())));
} else {
line_helper->moveto(start->first_segment()->initialPoint());
}
@@ -175,7 +178,7 @@ void LPEBSpline::doEffect(SPCurve *curve)
cubic = dynamic_cast<Geom::CubicBezier const *>(&*curve_it1);
if (cubic) {
line_helper->lineto(sbasis_end.valueAt(
- Geom::nearest_point((*cubic)[2], *end->first_segment())));
+ Geom::nearest_time((*cubic)[2], *end->first_segment())));
} else {
line_helper->lineto(end->first_segment()->finalPoint());
}
@@ -233,7 +236,7 @@ LPEBSpline::drawHandle(Geom::Point p, double helper_size)
Geom::Affine aff = Geom::Affine();
aff *= Geom::Scale(helper_size);
pathv *= aff;
- pathv += p - Geom::Point(0.5*helper_size, 0.5*helper_size);
+ pathv *= Geom::Translate(p - Geom::Point(0.5*helper_size, 0.5*helper_size));
hp.push_back(pathv[0]);
}