summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-09-15 23:07:32 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-09-15 23:07:32 +0000
commit0403ae2f0f76e56b31e369160648968671324d13 (patch)
treeb05668939f7461bca6f65c44177d986e6403386a /src
parentRoughen LPE: cleanup, improvements in code -loop part thanks Nathan-, credits... (diff)
downloadinkscape-0403ae2f0f76e56b31e369160648968671324d13.tar.gz
inkscape-0403ae2f0f76e56b31e369160648968671324d13.zip
fixing cusp node bug on bspline -problems moving nodes because tiny handles
(bzr r13341.1.209)
Diffstat (limited to 'src')
-rw-r--r--src/ui/tool/path-manipulator.cpp4
-rw-r--r--src/ui/tools/pen-tool.cpp8
2 files changed, 10 insertions, 2 deletions
diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp
index 5f20aece7..f30ecb1d1 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -1227,7 +1227,9 @@ double PathManipulator::BSplineHandlePosition(Handle *h, Handle *h2){
SPCurve *lineInsideNodes = new SPCurve();
lineInsideNodes->moveto(n->position());
lineInsideNodes->lineto(nextNode->position());
- pos = Geom::nearest_point(Geom::Point(h->position()[X] - handleCubicGap,h->position()[Y] - handleCubicGap),*lineInsideNodes->first_segment());
+ if(!are_near(h->position(), n->position())){
+ pos = Geom::nearest_point(Geom::Point(h->position()[X] ,h->position()[Y] - handleCubicGap),*lineInsideNodes->first_segment());
+ }
}
if (pos == 0.0000 && !h2){
return BSplineHandlePosition(h, h->other());
diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp
index 318591df5..b68231e10 100644
--- a/src/ui/tools/pen-tool.cpp
+++ b/src/ui/tools/pen-tool.cpp
@@ -1586,6 +1586,9 @@ void PenTool::_bspline_spiro_motion(bool shift){
if(this->green_curve->is_empty() && !this->sa){
this->p[1] = this->p[0] + (1./3)*(this->p[3] - this->p[0]);
this->p[1] = Geom::Point(this->p[1][X] + handleCubicGap,this->p[1][Y] + handleCubicGap);
+ if(shift){
+ this->p[2] = this->p[3];
+ }
}else if(!this->green_curve->is_empty()){
tmpCurve = this->green_curve->copy();
}else{
@@ -1609,8 +1612,11 @@ void PenTool::_bspline_spiro_motion(bool shift){
SBasisWPower = WPower->first_segment()->toSBasis();
WPower->reset();
this->p[1] = SBasisWPower.valueAt(WP);
- if(!Geom::are_near(this->p[1],this->p[0]))
+ if(!Geom::are_near(this->p[1],this->p[0])){
this->p[1] = Geom::Point(this->p[1][X] + handleCubicGap,this->p[1][Y] + handleCubicGap);
+ } else {
+ this->p[1] = this->p[0];
+ }
if(shift)
this->p[2] = this->p[3];
}else{