summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-02-19 11:08:14 +0000
committerJabiertxo Arraiza Zenotz <jtx@jtx.marker.es>2013-02-19 11:08:14 +0000
commitdfe131791aef37e26fd0358c32222dacf813864c (patch)
treee513052d3e756b099a379a89332148494295693d /src
parentrefactor (diff)
downloadinkscape-dfe131791aef37e26fd0358c32222dacf813864c.tar.gz
inkscape-dfe131791aef37e26fd0358c32222dacf813864c.zip
Mayor refactor
(bzr r11950.1.36)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-bspline.cpp80
-rw-r--r--src/pen-context.cpp82
-rw-r--r--src/ui/tool/node.cpp39
-rw-r--r--src/ui/tool/path-manipulator.cpp90
-rw-r--r--src/ui/tool/path-manipulator.h4
5 files changed, 151 insertions, 144 deletions
diff --git a/src/live_effects/lpe-bspline.cpp b/src/live_effects/lpe-bspline.cpp
index 858a09159..8147ae014 100644
--- a/src/live_effects/lpe-bspline.cpp
+++ b/src/live_effects/lpe-bspline.cpp
@@ -41,9 +41,6 @@ LPEBSpline::doEffect(SPCurve * curve)
Geom::PathVector const original_pathv = curve->get_pathvector();
curve->reset();
//Sbasis
- Geom::D2< Geom::SBasis > SBasisIn;
- Geom::D2< Geom::SBasis > SBasisOut;
- Geom::D2< Geom::SBasis > SBasisEnd;
Geom::D2< Geom::SBasis > SBasisHelper;
//curves
SPCurve * in = new SPCurve();
@@ -66,7 +63,9 @@ LPEBSpline::doEffect(SPCurve * curve)
Geom::Point nextPointAt1(0,0);
Geom::Point nextPointAt2(0,0);
Geom::Point nextPointAt3(0,0);
- Geom::BezierCurve const *bezier;
+ Geom::CubicBezier const *cubicIn;
+ Geom::CubicBezier const *cubicOut;
+ Geom::CubicBezier const *cubicEnd;
//Recorremos todos los paths a los que queremos aplicar el efecto, hasta el penúltimo
for(Geom::PathVector::const_iterator path_it = original_pathv.begin(); path_it != original_pathv.end(); ++path_it) {
//Si está vacío...
@@ -93,15 +92,12 @@ LPEBSpline::doEffect(SPCurve * curve)
//Si la curva está cerrada calculamos el punto donde
//deveria estar el nodo BSpline de cierre/inicio de la curva
//en posible caso de que se cierre con una linea recta creando un nodo BSPline
- bezier = dynamic_cast<Geom::BezierCurve const*>(&*curve_end);
- if (path_it->closed() && bezier && (*bezier)[2] != (*bezier)[3]) {
+ cubicEnd = dynamic_cast<Geom::CubicBezier const*>(&*curve_end);
+ cubicIn = dynamic_cast<Geom::CubicBezier const*>(&*curve_it1);
+ if (path_it->closed() && cubicEnd && cubicIn) {
//Calculamos el nodo de inicio BSpline
- SBasisIn = in->first_segment()->toSBasis();
- SBasisEnd = end->first_segment()->toSBasis();
- bezier = dynamic_cast<Geom::BezierCurve const*>(&*curve_it1);
- lineHelper->moveto(SBasisIn.valueAt(Geom::nearest_point((*bezier)[1],*in->first_segment())));
- bezier = dynamic_cast<Geom::BezierCurve const*>(&*curve_end);
- lineHelper->lineto(SBasisEnd.valueAt(Geom::nearest_point((*bezier)[2],*end->first_segment())));
+ lineHelper->moveto((*cubicIn)[1]);
+ lineHelper->lineto((*cubicEnd)[2]);
SBasisHelper = lineHelper->first_segment()->toSBasis();
lineHelper->reset();
//Guardamos el principio de la curva
@@ -118,53 +114,45 @@ LPEBSpline::doEffect(SPCurve * curve)
//Recorremos todos los segmentos menos el último
while ( curve_it2 != curve_endit )
{
- SBasisIn = in->first_segment()->toSBasis();
- SBasisOut = out->first_segment()->toSBasis();
//previousPointAt3 = pointAt3;
//Calculamos los puntos que dividirían en tres segmentos iguales el path recto de entrada y de salida
- bezier = dynamic_cast<Geom::BezierCurve const*>(&*curve_it1);
- if(bezier){
- pointAt0 = SBasisIn.valueAt(0);
- pointAt1 = SBasisIn.valueAt(Geom::nearest_point((*bezier)[1],*in->first_segment()));
- pointAt2 = SBasisIn.valueAt(Geom::nearest_point((*bezier)[2],*in->first_segment()));
- pointAt3 = SBasisIn.valueAt(1);
+ cubicIn = dynamic_cast<Geom::CubicBezier const*>(&*curve_it1);
+ if(cubicIn){
+ pointAt0 = (*cubicIn)[0];
+ pointAt1 = (*cubicIn)[1];
+ pointAt2 = (*cubicIn)[2];
+ pointAt3 = (*cubicIn)[3];
}else{
- pointAt0 = SBasisIn.valueAt(0);
- pointAt1 = SBasisIn.valueAt(0);
- pointAt2 = SBasisIn.valueAt(1);
- pointAt3 = SBasisIn.valueAt(1);
+ pointAt0 = in->first_segment()->initialPoint();
+ pointAt1 = in->first_segment()->initialPoint();
+ pointAt2 = in->first_segment()->finalPoint();
+ pointAt3 = in->first_segment()->finalPoint();
}
//Y hacemos lo propio con el path de salida
//nextPointAt0 = curveOut.valueAt(0);
- bezier = dynamic_cast<Geom::BezierCurve const*>(&*curve_it2);
- if(bezier){
- nextPointAt1 = SBasisOut.valueAt(Geom::nearest_point((*bezier)[1],*out->first_segment()));
- nextPointAt2 = SBasisOut.valueAt(Geom::nearest_point((*bezier)[2],*out->first_segment()));
- nextPointAt3 = SBasisOut.valueAt(1);
+ cubicOut = dynamic_cast<Geom::CubicBezier const*>(&*curve_it2);
+ if(cubicOut){
+ nextPointAt1 = (*cubicOut)[1];
+ nextPointAt2 = (*cubicOut)[2];
+ nextPointAt3 = (*cubicOut)[3];
}else{
- nextPointAt1 = SBasisOut.valueAt(0);
- nextPointAt2 = SBasisOut.valueAt(1);
- nextPointAt3 = SBasisOut.valueAt(1);
+ nextPointAt1 = in->first_segment()->initialPoint();
+ nextPointAt2 = in->first_segment()->finalPoint();
+ nextPointAt3 = in->first_segment()->finalPoint();
}
//La curva BSpline se forma calculando el centro del segmanto de unión
//de el punto situado en las 2/3 partes de el segmento de entrada
//con el punto situado en la posición 1/3 del segmento de salida
//Estos dos puntos ademas estan posicionados en el lugas correspondiente de
//los manejadores de la curva
- if(nextPointAt1 != pointAt2){
- lineHelper->moveto(pointAt2);
- lineHelper->lineto(nextPointAt1);
- SBasisHelper = lineHelper->first_segment()->toSBasis();
- lineHelper->reset();
- //almacenamos el punto del anterior bucle -o el de cierre- que nos hara de principio de curva
- previousNode = node;
- //Y este hará de final de curva
- node = SBasisHelper.valueAt(0.5);
- }else{
- previousNode = node;
- //Y este hará de final de curva
- node = nextPointAt1;
- }
+ lineHelper->moveto(pointAt2);
+ lineHelper->lineto(nextPointAt1);
+ SBasisHelper = lineHelper->first_segment()->toSBasis();
+ lineHelper->reset();
+ //almacenamos el punto del anterior bucle -o el de cierre- que nos hara de principio de curva
+ previousNode = node;
+ //Y este hará de final de curva
+ node = SBasisHelper.valueAt(0.5);
curveHelper->moveto(previousNode);
curveHelper->curveto(pointAt1, pointAt2, node);
//añadimos la curva generada a la curva pricipal
diff --git a/src/pen-context.cpp b/src/pen-context.cpp
index 26eb77b06..e393a706b 100644
--- a/src/pen-context.cpp
+++ b/src/pen-context.cpp
@@ -1985,9 +1985,6 @@ static void __attribute__((optimize(0))) bspline_doEffect(SPCurve * curve)
Geom::PathVector const original_pathv = curve->get_pathvector();
curve->reset();
//Sbasis
- Geom::D2< Geom::SBasis > SBasisIn;
- Geom::D2< Geom::SBasis > SBasisOut;
- Geom::D2< Geom::SBasis > SBasisEnd;
Geom::D2< Geom::SBasis > SBasisHelper;
//curves
SPCurve * in = new SPCurve();
@@ -2010,7 +2007,9 @@ static void __attribute__((optimize(0))) bspline_doEffect(SPCurve * curve)
Geom::Point nextPointAt1(0,0);
Geom::Point nextPointAt2(0,0);
Geom::Point nextPointAt3(0,0);
- Geom::BezierCurve const *bezier;
+ Geom::CubicBezier const *cubicIn;
+ Geom::CubicBezier const *cubicOut;
+ Geom::CubicBezier const *cubicEnd;
//Recorremos todos los paths a los que queremos aplicar el efecto, hasta el penúltimo
for(Geom::PathVector::const_iterator path_it = original_pathv.begin(); path_it != original_pathv.end(); ++path_it) {
//Si está vacío...
@@ -2037,15 +2036,12 @@ static void __attribute__((optimize(0))) bspline_doEffect(SPCurve * curve)
//Si la curva está cerrada calculamos el punto donde
//deveria estar el nodo BSpline de cierre/inicio de la curva
//en posible caso de que se cierre con una linea recta creando un nodo BSPline
- bezier = dynamic_cast<Geom::BezierCurve const*>(&*curve_end);
- if (path_it->closed() && bezier && (*bezier)[2] != (*bezier)[3]) {
+ cubicEnd = dynamic_cast<Geom::CubicBezier const*>(&*curve_end);
+ cubicIn = dynamic_cast<Geom::CubicBezier const*>(&*curve_it1);
+ if (path_it->closed() && cubicEnd && cubicIn) {
//Calculamos el nodo de inicio BSpline
- SBasisIn = in->first_segment()->toSBasis();
- SBasisEnd = end->first_segment()->toSBasis();
- bezier = dynamic_cast<Geom::BezierCurve const*>(&*curve_it1);
- lineHelper->moveto(SBasisIn.valueAt(Geom::nearest_point((*bezier)[1],*in->first_segment())));
- bezier = dynamic_cast<Geom::BezierCurve const*>(&*curve_end);
- lineHelper->lineto(SBasisEnd.valueAt(Geom::nearest_point((*bezier)[2],*end->first_segment())));
+ lineHelper->moveto((*cubicIn)[1]);
+ lineHelper->lineto((*cubicEnd)[2]);
SBasisHelper = lineHelper->first_segment()->toSBasis();
lineHelper->reset();
//Guardamos el principio de la curva
@@ -2062,53 +2058,45 @@ static void __attribute__((optimize(0))) bspline_doEffect(SPCurve * curve)
//Recorremos todos los segmentos menos el último
while ( curve_it2 != curve_endit )
{
- SBasisIn = in->first_segment()->toSBasis();
- SBasisOut = out->first_segment()->toSBasis();
//previousPointAt3 = pointAt3;
//Calculamos los puntos que dividirían en tres segmentos iguales el path recto de entrada y de salida
- bezier = dynamic_cast<Geom::BezierCurve const*>(&*curve_it1);
- if(bezier){
- pointAt0 = SBasisIn.valueAt(0);
- pointAt1 = SBasisIn.valueAt(Geom::nearest_point((*bezier)[1],*in->first_segment()));
- pointAt2 = SBasisIn.valueAt(Geom::nearest_point((*bezier)[2],*in->first_segment()));
- pointAt3 = SBasisIn.valueAt(1);
+ cubicIn = dynamic_cast<Geom::CubicBezier const*>(&*curve_it1);
+ if(cubicIn){
+ pointAt0 = (*cubicIn)[0];
+ pointAt1 = (*cubicIn)[1];
+ pointAt2 = (*cubicIn)[2];
+ pointAt3 = (*cubicIn)[3];
}else{
- pointAt0 = SBasisIn.valueAt(0);
- pointAt1 = SBasisIn.valueAt(0);
- pointAt2 = SBasisIn.valueAt(1);
- pointAt3 = SBasisIn.valueAt(1);
+ pointAt0 = in->first_segment()->initialPoint();
+ pointAt1 = in->first_segment()->initialPoint();
+ pointAt2 = in->first_segment()->finalPoint();
+ pointAt3 = in->first_segment()->finalPoint();
}
//Y hacemos lo propio con el path de salida
//nextPointAt0 = curveOut.valueAt(0);
- bezier = dynamic_cast<Geom::BezierCurve const*>(&*curve_it2);
- if(bezier){
- nextPointAt1 = SBasisOut.valueAt(Geom::nearest_point((*bezier)[1],*out->first_segment()));
- nextPointAt2 = SBasisOut.valueAt(Geom::nearest_point((*bezier)[2],*out->first_segment()));
- nextPointAt3 = SBasisOut.valueAt(1);
+ cubicOut = dynamic_cast<Geom::CubicBezier const*>(&*curve_it2);
+ if(cubicOut){
+ nextPointAt1 = (*cubicOut)[1];
+ nextPointAt2 = (*cubicOut)[2];
+ nextPointAt3 = (*cubicOut)[3];
}else{
- nextPointAt1 = SBasisOut.valueAt(0);
- nextPointAt2 = SBasisOut.valueAt(1);
- nextPointAt3 = SBasisOut.valueAt(1);
+ nextPointAt1 = in->first_segment()->initialPoint();
+ nextPointAt2 = in->first_segment()->finalPoint();
+ nextPointAt3 = in->first_segment()->finalPoint();
}
//La curva BSpline se forma calculando el centro del segmanto de unión
//de el punto situado en las 2/3 partes de el segmento de entrada
//con el punto situado en la posición 1/3 del segmento de salida
//Estos dos puntos ademas estan posicionados en el lugas correspondiente de
//los manejadores de la curva
- if(nextPointAt1 != pointAt2){
- lineHelper->moveto(pointAt2);
- lineHelper->lineto(nextPointAt1);
- SBasisHelper = lineHelper->first_segment()->toSBasis();
- lineHelper->reset();
- //almacenamos el punto del anterior bucle -o el de cierre- que nos hara de principio de curva
- previousNode = node;
- //Y este hará de final de curva
- node = SBasisHelper.valueAt(0.5);
- }else{
- previousNode = node;
- //Y este hará de final de curva
- node = nextPointAt1;
- }
+ lineHelper->moveto(pointAt2);
+ lineHelper->lineto(nextPointAt1);
+ SBasisHelper = lineHelper->first_segment()->toSBasis();
+ lineHelper->reset();
+ //almacenamos el punto del anterior bucle -o el de cierre- que nos hara de principio de curva
+ previousNode = node;
+ //Y este hará de final de curva
+ node = SBasisHelper.valueAt(0.5);
curveHelper->moveto(previousNode);
curveHelper->curveto(pointAt1, pointAt2, node);
//añadimos la curva generada a la curva pricipal
@@ -2159,7 +2147,7 @@ static void __attribute__((optimize(0))) bspline_doEffect(SPCurve * curve)
//Todo: remove?
//delete SBasisHelper;
}
-
+
//BSpline end
static void spdc_pen_set_subsequent_point(SPPenContext *const pc, Geom::Point const p, bool statusbar, guint status)
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp
index dff8d3dd9..1a196c857 100644
--- a/src/ui/tool/node.cpp
+++ b/src/ui/tool/node.cpp
@@ -135,6 +135,15 @@ void Handle::move(Geom::Point const &new_pos)
Node *node_away = _parent->nodeAwayFrom(this); // node in the opposite direction
Handle *towards = node_towards ? node_towards->handleAwayFrom(_parent) : NULL;
Handle *towards_second = node_towards ? node_towards->handleToward(_parent) : NULL;
+ //BSpline
+ bool isBSpline = false;
+ double pos = 0;
+ Handle *h = NULL;
+ Handle *h2 = NULL;
+ if(_pm().isBSpline()){
+ isBSpline = true;
+ //BSpline End
+ }
if (Geom::are_near(new_pos, _parent->position())) {
// The handle becomes degenerate.
@@ -165,6 +174,15 @@ void Handle::move(Geom::Point const &new_pos)
other->setDirection(*node_towards, *_parent);
}
}
+ //BSpline
+ if(isBSpline){
+ h = this;
+ setPosition(_pm().BSplineHandleReposition(h));
+ pos = _pm().BSplineHandlePosition(h);
+ h2 = this->other();
+ this->other()->setPosition(_pm().BSplineHandleReposition(h2,pos));
+ }
+ //BSpline End
setPosition(new_pos);
return;
}
@@ -195,12 +213,15 @@ void Handle::move(Geom::Point const &new_pos)
break;
default: break;
}
+ setPosition(new_pos);
//BSpline
- if(_pm().isBSpline()){
- Handle *h = this;
+ if(isBSpline){
+ h = this;
setPosition(_pm().BSplineHandleReposition(h));
- }else
- setPosition(new_pos);
+ pos = _pm().BSplineHandlePosition(h);
+ h2 = this->other();
+ this->other()->setPosition(_pm().BSplineHandleReposition(h2,pos));
+ }
//BSpline End
}
@@ -555,10 +576,12 @@ void Node::move(Geom::Point const &new_pos)
Geom::Point old_pos = position();
Geom::Point delta = new_pos - position();
//BSpline
- float pos = 0;
+ double pos = 0;
if(_pm().isBSpline()){
Node *n = this;
- pos = _pm().BSplineMaxPosition(n);
+ pos = _pm().BSplineHandlePosition(n->front());
+ if(pos == 0)
+ pos = _pm().BSplineHandlePosition(n->back());
}
//BSpline End
setPosition(new_pos);
@@ -568,8 +591,8 @@ void Node::move(Geom::Point const &new_pos)
if(_pm().isBSpline()){
Handle* front = &_front;
Handle* back = &_back;
- _front.setPosition(_pm().BSplineHandleRepositionFixed(front,pos));
- _back.setPosition(_pm().BSplineHandleRepositionFixed(back,pos));
+ _front.setPosition(_pm().BSplineHandleReposition(front,pos));
+ _back.setPosition(_pm().BSplineHandleReposition(back,pos));
}
//BSpline End
// if the node has a smooth handle after a line segment, it should be kept colinear
diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp
index b650987bc..c4158931a 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -1182,31 +1182,8 @@ bool PathManipulator::isBSpline(){
}
return false;
}
-double PathManipulator::BSplineMaxPosition(Node *n){
- double nearestPointAt = 0;
- Geom::D2< Geom::SBasis > SBasisInsideNodes;
- SPCurve *lineInsideNodes = new SPCurve();
- Node * frontNode = n->nodeToward(n->front());
- if(frontNode){
- lineInsideNodes->moveto(n->position());
- lineInsideNodes->lineto(frontNode->position());
- SBasisInsideNodes = lineInsideNodes->first_segment()->toSBasis();
- nearestPointAt = Geom::nearest_point(n->front()->position(),*lineInsideNodes->first_segment());
- }
- Node * backNode = n->nodeToward(n->back());
- if(backNode){
- lineInsideNodes->reset();
- lineInsideNodes->moveto(n->position());
- lineInsideNodes->lineto(backNode->position());
- SBasisInsideNodes = lineInsideNodes->first_segment()->toSBasis();
- using std::max;
- nearestPointAt = max(nearestPointAt,1-Geom::nearest_point(n->back()->position(),*lineInsideNodes->first_segment()));
- }
- return nearestPointAt;
-}
-
-Geom::Point PathManipulator::BSplineHandleReposition(Handle *h){
- double nearestPointAt = 0;
+double PathManipulator::BSplineHandlePosition(Handle *h){
+ double pos = 0;
Node *n = h->parent();
Geom::D2< Geom::SBasis > SBasisInsideNodes;
SPCurve *lineInsideNodes = new SPCurve();
@@ -1215,19 +1192,23 @@ Geom::Point PathManipulator::BSplineHandleReposition(Handle *h){
lineInsideNodes->moveto(n->position());
lineInsideNodes->lineto(nextNode->position());
SBasisInsideNodes = lineInsideNodes->first_segment()->toSBasis();
- nearestPointAt = Geom::nearest_point(n->front()->position(),*lineInsideNodes->first_segment());
+ pos = Geom::nearest_point(h->position(),*lineInsideNodes->first_segment());
}
- return SBasisInsideNodes.valueAt(nearestPointAt);
+ return pos;
}
-Geom::Point PathManipulator::BSplineHandleRepositionFixed(Handle *h,double pos){
+Geom::Point PathManipulator::BSplineHandleReposition(Handle *h){
+ double pos = 0;
+ pos = this->BSplineHandlePosition(h);
+ return BSplineHandleReposition(h,pos);
+}
+
+Geom::Point PathManipulator::BSplineHandleReposition(Handle *h,double pos){
Node *n = h->parent();
- if(n->back()->position() == h->position())
- pos = 1-pos;
Geom::D2< Geom::SBasis > SBasisInsideNodes;
SPCurve *lineInsideNodes = new SPCurve();
Node * nextNode = n->nodeToward(h);
- if(nextNode){
+ if(nextNode && pos != 0){
lineInsideNodes->moveto(n->position());
lineInsideNodes->lineto(nextNode->position());
SBasisInsideNodes = lineInsideNodes->first_segment()->toSBasis();
@@ -1251,26 +1232,53 @@ void PathManipulator::_createGeometryFromControlPoints(bool alert_LPE)
continue;
}
NodeList::iterator prev = subpath->begin();
+ //BSpline
+ float pos = NULL;
+ bool isBSpline = false;
+ if(this->isBSpline())
+ isBSpline = true;
+ if(isBSpline){
+ pos = BSplineHandlePosition(prev.ptr()->front());
+ prev.ptr()->front()->setPosition(BSplineHandleReposition(prev.ptr()->front(),pos));
+ if(pos == 0){
+ prev.ptr()->setPosition(BSplineHandleReposition(i.ptr()->front(),pos));
+ }
+ }
+ //BSpline End
builder.moveTo(prev->position());
for (NodeList::iterator i = ++subpath->begin(); i != subpath->end(); ++i) {
- if (this->isBSpline()) {
- float pos = BSplineMaxPosition(i.ptr());
- i.ptr()->front()->setPosition(BSplineHandleRepositionFixed(i.ptr()->front(),pos));
- i.ptr()->back()->setPosition(BSplineHandleRepositionFixed(i.ptr()->back(),pos));
+ //BSpline
+ if (isBSpline) {
+ pos = BSplineHandlePosition(i.ptr()->front());
+ if(pos == 0)
+ pos = BSplineHandlePosition(i.ptr()->back());
+ i.ptr()->front()->setPosition(BSplineHandleReposition(i.ptr()->front(),pos));
+ i.ptr()->back()->setPosition(BSplineHandleReposition(i.ptr()->back(),pos));
+ if(pos == 0){
+ i.ptr()->setPosition(BSplineHandleReposition(i.ptr()->front(),pos));
+ }
}
- //BSplie End
+
+ //BSpline End
build_segment(builder, prev.ptr(), i.ptr());
prev = i;
}
if (subpath->closed()) {
// Here we link the last and first node if the path is closed.
// If the last segment is Bezier, we add it.
- if (this->isBSpline()) {
- float pos = BSplineMaxPosition(prev.ptr());
- subpath->begin().ptr()->front()->setPosition(BSplineHandleRepositionFixed(subpath->begin().ptr()->front(),pos));
- prev.ptr()->back()->setPosition(BSplineHandleRepositionFixed(prev.ptr()->back(),pos));
-
+ //BSpline
+ if (isBSpline) {
+ pos = BSplineHandlePosition(prev.ptr()->front());
+ if(pos == 0)
+ pos = BSplineHandlePosition(subpath->begin().ptr()->back());
+ subpath->begin().ptr()->front()->setPosition(BSplineHandleReposition(subpath->begin().ptr()->front(),pos));
+ prev.ptr()->back()->setPosition(BSplineHandleReposition(prev.ptr()->back(),pos));
+ if(pos == 0){
+ subpath->begin().ptr()->setPosition(BSplineHandleReposition(subpath->begin().ptr()->front(),pos));
+ prev.ptr()->setPosition(BSplineHandleReposition(prev.ptr()->back(),pos));
+ }
}
+ //BSpline End
if (!prev->front()->isDegenerate() || !subpath->begin()->back()->isDegenerate()) {
build_segment(builder, prev.ptr(), subpath->begin().ptr());
}
diff --git a/src/ui/tool/path-manipulator.h b/src/ui/tool/path-manipulator.h
index 72d84a241..55958530d 100644
--- a/src/ui/tool/path-manipulator.h
+++ b/src/ui/tool/path-manipulator.h
@@ -106,9 +106,9 @@ private:
void _createControlPointsFromGeometry();
//BSpline
bool isBSpline();
- double BSplineMaxPosition(Node *n);
+ double BSplineHandlePosition(Handle *h);
Geom::Point BSplineHandleReposition(Handle *h);
- Geom::Point BSplineHandleRepositionFixed(Handle *h,double pos);
+ Geom::Point BSplineHandleReposition(Handle *h,double pos);
//BSpline End
void _createGeometryFromControlPoints(bool alert_LPE = false);
unsigned _deleteStretch(NodeList::iterator first, NodeList::iterator last, bool keep_shape);