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:45:38 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-03-21 11:45:38 +0000
commitae1bd880cb7f913509b1b0e2de1fa4aa7e430d15 (patch)
treee33854bcd072cc52662b532f750bc7356f3f9f1a /src/ui/tool/path-manipulator.cpp
parentAdd GUI for 'viewBox'. (diff)
downloadinkscape-ae1bd880cb7f913509b1b0e2de1fa4aa7e430d15.tar.gz
inkscape-ae1bd880cb7f913509b1b0e2de1fa4aa7e430d15.zip
Improve the cache system of bspline, "Correctly" show bspline weight power on nodes and handles
(bzr r14023)
Diffstat (limited to 'src/ui/tool/path-manipulator.cpp')
-rw-r--r--src/ui/tool/path-manipulator.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp
index dbcde240a..8b735f3e6 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -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() const {
- return BSplineGetSteps() > 0;
+ 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);
}