summaryrefslogtreecommitdiffstats
path: root/src/ui/tool/path-manipulator.cpp
diff options
context:
space:
mode:
authorjtx <javier.arraiza@marker.es>2013-03-20 15:15:12 +0000
committerjtx <javier.arraiza@marker.es>2013-03-20 15:15:12 +0000
commit6bdbe4b651d2a643d751803572df3e8f247a8707 (patch)
treeb04d653761d70bc92858723b3f2ecc0e8010c077 /src/ui/tool/path-manipulator.cpp
parentFixing regression (diff)
parentFor testing, widget added, regression fixed (diff)
downloadinkscape-6bdbe4b651d2a643d751803572df3e8f247a8707.tar.gz
inkscape-6bdbe4b651d2a643d751803572df3e8f247a8707.zip
Fixing node creations in BSpline mode.
(bzr r11950.4.1)
Diffstat (limited to 'src/ui/tool/path-manipulator.cpp')
-rw-r--r--src/ui/tool/path-manipulator.cpp39
1 files changed, 14 insertions, 25 deletions
diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp
index 853d9336a..e789d5447 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -149,6 +149,19 @@ PathManipulator::PathManipulator(MultiPathManipulator &mpm, SPPath *path,
sigc::hide( sigc::mem_fun(*this, &PathManipulator::_updateOutlineOnZoomChange)));
_createControlPointsFromGeometry();
+
+ LivePathEffect::LPEBSpline *lpe_bsp = NULL;
+ if (SP_LPE_ITEM(_path) && sp_lpe_item_has_path_effect(SP_LPE_ITEM(_path))){
+ Inkscape::LivePathEffect::Effect* thisEffect = sp_lpe_item_has_path_effect_of_type(SP_LPE_ITEM(_path),Inkscape::LivePathEffect::BSPLINE);
+ if(thisEffect){
+ lpe_bsp = dynamic_cast<LivePathEffect::LPEBSpline*>(thisEffect->getLPEObj()->get_lpe());
+ }
+ }
+ isBSpline = false;
+ if(lpe_bsp){
+ isBSpline = true;
+ controlBSplineSteps = lpe_bsp->steps+1;
+ }
}
PathManipulator::~PathManipulator()
@@ -897,7 +910,7 @@ void PathManipulator::showHandles(bool show)
void PathManipulator::showOutline(bool show)
{
//BSpline
- if(isBSpline()) show = true;
+ if(isBSpline) show = true;
//BSpline
if (show == _show_outline) return;
_show_outline = show;
@@ -1172,30 +1185,6 @@ void PathManipulator::_createControlPointsFromGeometry()
}
}
-
-bool PathManipulator::isBSpline(){
- LivePathEffect::LPEBSpline *lpe_bsp = NULL;
- if (SP_LPE_ITEM(_path) && sp_lpe_item_has_path_effect(SP_LPE_ITEM(_path))){
- lpe_bsp = dynamic_cast<LivePathEffect::LPEBSpline*>(sp_lpe_item_has_path_effect_of_type(SP_LPE_ITEM(_path),Inkscape::LivePathEffect::BSPLINE)->getLPEObj()->get_lpe());
- }else{
- lpe_bsp = NULL;
- }
- if(lpe_bsp){
- return true;
- }
- return false;
-}
-
-int PathManipulator::getControlBsplineSteps(){
- LivePathEffect::LPEBSpline *lpe_bsp = NULL;
- if (SP_LPE_ITEM(_path) && sp_lpe_item_has_path_effect(SP_LPE_ITEM(_path))){
- lpe_bsp = dynamic_cast<LivePathEffect::LPEBSpline*>(sp_lpe_item_has_path_effect_of_type(SP_LPE_ITEM(_path),Inkscape::LivePathEffect::BSPLINE)->getLPEObj()->get_lpe());
- if(lpe_bsp){
- return lpe_bsp->steps+1;
- }
- }
- return 2;
-}
double PathManipulator::BSplineHandlePosition(Handle *h){
using Geom::X;
using Geom::Y;