summaryrefslogtreecommitdiffstats
path: root/src/ui/tools/freehand-base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/tools/freehand-base.cpp')
-rw-r--r--src/ui/tools/freehand-base.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp
index 52f578d13..bff24346a 100644
--- a/src/ui/tools/freehand-base.cpp
+++ b/src/ui/tools/freehand-base.cpp
@@ -235,20 +235,13 @@ static void spdc_apply_powerstroke_shape(std::vector<Geom::Point> points, Freeha
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
if (dc->input_has_pressure) {
SPShape *sp_shape = dynamic_cast<SPShape *>(item);
- Geom::PathVector pathv;
if (sp_shape) {
SPCurve * c = sp_shape->getCurve();
if (!c) {
- pt->points.clear();
return;
}
- pathv = c->get_pathvector();
- SPCurve * tmp_curve_to_adjust = new SPCurve();
- tmp_curve_to_adjust->set_pathvector(pt->pressure_pv);
- sp_shape->setCurve(tmp_curve_to_adjust, true);
- tmp_curve_to_adjust->unref();
+ pt->addPowerStrokePencil(c);
}
- pt->removePowerStrokePreview();
double zoom = SP_EVENT_CONTEXT(dc)->desktop->current_zoom() * 5.0;
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
double min = prefs->getIntLimited("/tools/freehand/pencil/minpressure", 0, 1, 100) / 100.0;
@@ -265,18 +258,7 @@ static void spdc_apply_powerstroke_shape(std::vector<Geom::Point> points, Freeha
}
Effect::createAndApply(POWERSTROKE, dc->desktop->doc(), item);
Effect* lpe = SP_LPE_ITEM(item)->getCurrentLPE();
- lpe->getRepr()->setAttribute("interpolator_type" , "CubicBezierSmooth");
- LPEPowerStroke* pslpe = static_cast<LPEPowerStroke*>(lpe);
- if (pslpe) {
- pslpe->offset_points.param_set_and_write_new_value(pt->points);
- if (sp_shape) {
- SPCurve * tmp_curve_to_adjust = new SPCurve();
- tmp_curve_to_adjust->set_pathvector(pathv);
- sp_shape->setCurve(tmp_curve_to_adjust, true);
- tmp_curve_to_adjust->unref();
- pslpe->adjustForNewPath(pt->pressure_pv);
- }
- }
+ static_cast<LPEPowerStroke*>(lpe)->offset_points.param_set_and_write_new_value(pt->points);
pt->points.clear();
return;
}