summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-03-19 03:35:35 +0000
committerJabiertxo Arraiza Zenotz <jtx@jtx.marker.es>2013-03-19 03:35:35 +0000
commit4e41340374ba833e748ffbbc610a28c7c3559557 (patch)
treeacbae23477b3c4c42ab9673731ac8c7473824d80 /src/ui
parentworking whith widgets (diff)
downloadinkscape-4e41340374ba833e748ffbbc610a28c7c3559557.tar.gz
inkscape-4e41340374ba833e748ffbbc610a28c7c3559557.zip
Working width widgets
(bzr r11950.1.58)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/tool/node.cpp7
-rw-r--r--src/ui/tool/node.h5
-rw-r--r--src/ui/tool/path-manipulator.cpp2
3 files changed, 4 insertions, 10 deletions
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp
index b628d3500..819f5db54 100644
--- a/src/ui/tool/node.cpp
+++ b/src/ui/tool/node.cpp
@@ -110,12 +110,9 @@ Handle::Handle(NodeSharedData const &data, Geom::Point const &initial_pos, Node
_handle_colors, data.handle_group),
_parent(parent),
_handle_line(ControlManager::getManager().createControlLine(data.handle_line_group)),
- _degenerate(true)
+ _degenerate(true),controlBsplineSteps(2)
{
setVisible(false);
- //BSpline
- setControlBsplineSteps( _pm().getControlBsplineSteps());
- //BSpline End;
}
Handle::~Handle()
@@ -394,7 +391,7 @@ void Handle::dragged(Geom::Point &new_pos, GdkEventMotion *event)
double pos = 0;
h = this;
setPosition(new_pos);
- pos = ceilf(_pm().BSplineHandlePosition(h)*controlBsplineSteps)/controlBsplineSteps;
+ pos = ceilf(_pm().BSplineHandlePosition(h)*_pm().getControlBsplineSteps())/_pm().getControlBsplineSteps();
new_pos=_pm().BSplineHandleReposition(h,pos);
}
//BSpline End
diff --git a/src/ui/tool/node.h b/src/ui/tool/node.h
index 953ac0061..7152f37fd 100644
--- a/src/ui/tool/node.h
+++ b/src/ui/tool/node.h
@@ -89,7 +89,6 @@ public:
virtual void setVisible(bool);
virtual void move(Geom::Point const &p);
-
virtual void setPosition(Geom::Point const &p);
inline void setRelativePos(Geom::Point const &p);
void setLength(double len);
@@ -109,8 +108,6 @@ protected:
virtual bool _eventHandler(SPEventContext *event_context, GdkEvent *event);
//Bspline
virtual void handle_2button_press();
- virtual void setControlBsplineSteps(int controlBsplineStepsValue){controlBsplineSteps = controlBsplineStepsValue;};
- int controlBsplineSteps;
//BSpline End
virtual void dragged(Geom::Point &new_pos, GdkEventMotion *event);
virtual bool grabbed(GdkEventMotion *event);
@@ -129,7 +126,7 @@ private:
// so a naked pointer is OK and allows setting it during Node's construction
SPCtrlLine *_handle_line;
bool _degenerate; // True if the handle is retracted, i.e. has zero length. This is used often internally so it makes sense to cache this
-
+ int controlBsplineSteps;
/**
* Control point of a cubic Bezier curve in a path.
*
diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp
index b46e85622..853d9336a 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -1191,7 +1191,7 @@ int PathManipulator::getControlBsplineSteps(){
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 lpe_bsp->steps+1;
}
}
return 2;