summaryrefslogtreecommitdiffstats
path: root/src/ui/tool/path-manipulator.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-03-18 01:53:59 +0000
committerJabiertxo Arraiza Zenotz <jtx@jtx.marker.es>2013-03-18 01:53:59 +0000
commita5fc5840c370d58f395b7b256a11fd11ef3a9a54 (patch)
tree0136821ae5b542e224d85a124f597002d45470b4 /src/ui/tool/path-manipulator.cpp
parentWorking with widjets (diff)
downloadinkscape-a5fc5840c370d58f395b7b256a11fd11ef3a9a54.tar.gz
inkscape-a5fc5840c370d58f395b7b256a11fd11ef3a9a54.zip
working whith widgets
(bzr r11950.1.57)
Diffstat (limited to 'src/ui/tool/path-manipulator.cpp')
-rw-r--r--src/ui/tool/path-manipulator.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp
index 0a100ecfb..b46e85622 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -36,6 +36,7 @@
#include "live_effects/lpeobject-reference.h"
#include "live_effects/parameter/path.h"
#include "sp-path.h"
+#include "sp-lpe-item.h"
#include "helper/geom.h"
#include "preferences.h"
#include "style.h"
@@ -1174,9 +1175,8 @@ void PathManipulator::_createControlPointsFromGeometry()
bool PathManipulator::isBSpline(){
LivePathEffect::LPEBSpline *lpe_bsp = NULL;
- if (SP_IS_LPE_ITEM(_path) && sp_lpe_item_has_path_effect(SP_LPE_ITEM(_path))) {
- PathEffectList effect_list = sp_lpe_item_get_effect_list(SP_LPE_ITEM(_path));
- lpe_bsp = dynamic_cast<LivePathEffect::LPEBSpline*>( effect_list.front()->lpeobject->get_lpe());
+ 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;
}
@@ -1186,6 +1186,16 @@ bool PathManipulator::isBSpline(){
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;
+ }
+ }
+ return 2;
+}
double PathManipulator::BSplineHandlePosition(Handle *h){
using Geom::X;
using Geom::Y;