From ae1bd880cb7f913509b1b0e2de1fa4aa7e430d15 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 21 Mar 2015 12:45:38 +0100 Subject: Improve the cache system of bspline, "Correctly" show bspline weight power on nodes and handles (bzr r14023) --- src/ui/tool/path-manipulator.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src/ui/tool/path-manipulator.cpp') 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(_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); } -- cgit v1.2.3