diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-05-13 05:34:59 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-05-13 05:34:59 +0000 |
| commit | 2e6927e7c4ae6b8592dd9f13e8c286ea899e82db (patch) | |
| tree | 85c2d6cb055ccce256ae829c042d8062ff914814 /src | |
| parent | Fixed a bug in bspline with snaps and 1 sice segments. Pointed by LiamW (diff) | |
| parent | Patch from Jabierxto to fix a bug I reported off-tracker. (diff) | |
| download | inkscape-2e6927e7c4ae6b8592dd9f13e8c286ea899e82db.tar.gz inkscape-2e6927e7c4ae6b8592dd9f13e8c286ea899e82db.zip | |
Update to trunk
(bzr r13341.1.11)
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/lpe-bspline.cpp | 22 | ||||
| -rw-r--r-- | src/ui/tool/node.cpp | 2 | ||||
| -rw-r--r-- | src/ui/tools/pen-tool.cpp | 22 |
3 files changed, 7 insertions, 39 deletions
diff --git a/src/live_effects/lpe-bspline.cpp b/src/live_effects/lpe-bspline.cpp index 454924d2b..edf19d1e5 100644 --- a/src/live_effects/lpe-bspline.cpp +++ b/src/live_effects/lpe-bspline.cpp @@ -96,7 +96,7 @@ void LPEBSpline::createAndApply(const char *name, SPDocument *doc, } void LPEBSpline::doEffect(SPCurve *curve) { - if (curve->get_segment_count() < 1) + if (curve->get_segment_count() < 2) return; // Make copy of old path as it is changed during processing Geom::PathVector const original_pathv = curve->get_pathvector(); @@ -216,26 +216,10 @@ void LPEBSpline::doEffect(SPCurve *curve) { ++curve_it1; ++curve_it2; } - SPCurve *out = new SPCurve(); - out->moveto(curve_it1->initialPoint()); - out->lineto(curve_it1->finalPoint()); - cubic = dynamic_cast<Geom::CubicBezier const *>(&*curve_it1); - if (cubic) { - SBasisOut = out->first_segment()->toSBasis(); - nextPointAt1 = SBasisOut.valueAt(Geom::nearest_point((*cubic)[1], *out->first_segment())); - nextPointAt2 = SBasisOut.valueAt(Geom::nearest_point((*cubic)[2], *out->first_segment())); - nextPointAt3 = out->first_segment()->finalPoint(); - } else { - nextPointAt1 = out->first_segment()->initialPoint(); - nextPointAt2 = out->first_segment()->finalPoint(); - nextPointAt3 = out->first_segment()->finalPoint(); - } - out->reset(); - delete out; //Si está cerrada la curva, la cerramos sobre el valor guardado //previamente //Si no finalizamos en el punto final - Geom::Point startNode = path_it->begin()->initialPoint(); + Geom::Point startNode(0, 0); if (path_it->closed()) { SPCurve *start = new SPCurve(); start->moveto(path_it->begin()->initialPoint()); @@ -437,7 +421,7 @@ void LPEBSpline::doBSplineFromWidget(SPCurve *curve, double weightValue) { } } //bool hasNodesSelected = LPEBspline::hasNodesSelected(); - if (curve->get_segment_count() < 1) + if (curve->get_segment_count() < 2) return; // Make copy of old path as it is changed during processing Geom::PathVector const original_pathv = curve->get_pathvector(); diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index ed0843b65..f077bcffc 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -371,7 +371,7 @@ void Handle::dragged(Geom::Point &new_pos, GdkEventMotion *event) std::vector<Inkscape::SnapCandidatePoint> unselected; //if the snap adjustment is activated and it is not bspline - if (snap && !_pm().isBSpline(false)) { + if (snap && !_pm().isBSpline()) { ControlPointSelection::Set &nodes = _parent->_selection.allPoints(); for (ControlPointSelection::Set::iterator i = nodes.begin(); i != nodes.end(); ++i) { Node *n = static_cast<Node*>(*i); diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp index 386dc43e9..9e4df5031 100644 --- a/src/ui/tools/pen-tool.cpp +++ b/src/ui/tools/pen-tool.cpp @@ -1811,9 +1811,9 @@ void PenTool::_bspline_spiro_build() void PenTool::_bspline_doEffect(SPCurve * curve) { // commenting the function doEffect in src/live_effects/lpe-bspline.cpp - Geom::PathVector const original_pathv = curve->get_pathvector(); - if (curve->get_segment_count() < 1) + if(curve->get_segment_count() < 2) return; + Geom::PathVector const original_pathv = curve->get_pathvector(); curve->reset(); for(Geom::PathVector::const_iterator path_it = original_pathv.begin(); path_it != original_pathv.end(); ++path_it) { @@ -1890,25 +1890,9 @@ void PenTool::_bspline_doEffect(SPCurve * curve) ++curve_it1; ++curve_it2; } - SPCurve *out = new SPCurve(); - out->moveto(curve_it1->initialPoint()); - out->lineto(curve_it1->finalPoint()); - cubic = dynamic_cast<Geom::CubicBezier const *>(&*curve_it1); - if (cubic) { - SBasisOut = out->first_segment()->toSBasis(); - nextPointAt1 = SBasisOut.valueAt(Geom::nearest_point((*cubic)[1], *out->first_segment())); - nextPointAt2 = SBasisOut.valueAt(Geom::nearest_point((*cubic)[2], *out->first_segment())); - nextPointAt3 = out->first_segment()->finalPoint(); - } else { - nextPointAt1 = out->first_segment()->initialPoint(); - nextPointAt2 = out->first_segment()->finalPoint(); - nextPointAt3 = out->first_segment()->finalPoint(); - } - out->reset(); - delete out; SPCurve *curveHelper = new SPCurve(); curveHelper->moveto(node); - Geom::Point startNode = path_it->begin()->initialPoint(); + Geom::Point startNode(0,0); if (path_it->closed()) { SPCurve * start = new SPCurve(); start->moveto(path_it->begin()->initialPoint()); |
