summaryrefslogtreecommitdiffstats
path: root/src/ui/tool/path-manipulator.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-03-21 11:52:05 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-03-21 11:52:05 +0000
commit35dbee2c542660e1ab2c2aa3ed8f0bc052ebd0a1 (patch)
tree1339b657212153803c8b575b3862a4864928da71 /src/ui/tool/path-manipulator.cpp
parentupdate to trunk (diff)
parentImprove the cache system of bspline, "Correctly" show bspline weight power on... (diff)
downloadinkscape-35dbee2c542660e1ab2c2aa3ed8f0bc052ebd0a1.tar.gz
inkscape-35dbee2c542660e1ab2c2aa3ed8f0bc052ebd0a1.zip
update to trunk
(bzr r13645.1.48)
Diffstat (limited to 'src/ui/tool/path-manipulator.cpp')
-rw-r--r--src/ui/tool/path-manipulator.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp
index 64eba3921..8b735f3e6 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -670,7 +670,7 @@ unsigned PathManipulator::_deleteStretch(NodeList::iterator start, NodeList::ite
start = next;
}
// if we are removing, we readjust the handlers
- if(isBSpline(false)){
+ if(isBSpline()){
if(start.prev()){
start.prev()->front()->setPosition(BSplineHandleReposition(start.prev()->front(),start.prev()->back()));
}
@@ -999,7 +999,7 @@ NodeList::iterator PathManipulator::subdivideSegment(NodeList::iterator first, d
// set new handle positions
Node *n = new Node(_multi_path_manipulator._path_data.node_data, seg2[0]);
- if(!isBSpline(false)){
+ if(!isBSpline()){
n->back()->setPosition(seg1[2]);
n->front()->setPosition(seg2[1]);
n->setType(NODE_SMOOTH, false);
@@ -1240,17 +1240,29 @@ int PathManipulator::BSplineGetSteps() const {
// determines if the trace has bspline effect
bool PathManipulator::isBSpline(bool recalculate){
if(recalculate){
- _is_bspline = this->BSplineGetSteps() > 0;
+ SPLPEItem * path = dynamic_cast<SPLPEItem *>(_path);
+ if (path){
+ if(path->hasPathEffect()){
+ Inkscape::LivePathEffect::Effect const *thisEffect = path->getPathEffectOfType(Inkscape::LivePathEffect::BSPLINE);
+ if(thisEffect){
+ _is_bspline = true;
+ return _is_bspline;
+ }
+ }
+ }
+
}
+ _is_bspline = false;
return _is_bspline;
}
-bool PathManipulator::isBSpline(false) const {
- return BSplineGetSteps() > 0;
+bool PathManipulator::isBSpline() const {
+ return _is_bspline;
}
// returns the corresponding strength to the position of the handlers
-double PathManipulator::BSplineHandlePosition(Handle *h, Handle *h2){
+double PathManipulator::BSplineHandlePosition(Handle *h, Handle *h2)
+{
using Geom::X;
using Geom::Y;
if(h2){
@@ -1275,7 +1287,8 @@ double PathManipulator::BSplineHandlePosition(Handle *h, Handle *h2){
}
// give the location for the handler in the corresponding position
-Geom::Point PathManipulator::BSplineHandleReposition(Handle *h, Handle *h2){
+Geom::Point PathManipulator::BSplineHandleReposition(Handle *h, Handle *h2)
+{
double pos = this->BSplineHandlePosition(h, h2);
return BSplineHandleReposition(h,pos);
}