summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-03-21 09:55:27 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-03-21 09:55:27 +0000
commitcfe5bd077cc29fd43385792435f687d468aca13f (patch)
tree3e23e244b5e33a6ab9ad5f2eadf4f65f6c1b5d4f /src/ui
parentAdded delete nodes/satellites (diff)
downloadinkscape-cfe5bd077cc29fd43385792435f687d468aca13f.tar.gz
inkscape-cfe5bd077cc29fd43385792435f687d468aca13f.zip
fix bspline calls and atemp to fic a bug whith map
(bzr r13645.1.46)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/tool/node.cpp20
-rw-r--r--src/ui/tool/path-manipulator.cpp6
-rw-r--r--src/ui/tool/path-manipulator.h2
3 files changed, 14 insertions, 14 deletions
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp
index eeea47e4d..5cfc2a0ca 100644
--- a/src/ui/tool/node.cpp
+++ b/src/ui/tool/node.cpp
@@ -175,7 +175,7 @@ void Handle::move(Geom::Point const &new_pos)
setPosition(new_pos);
//move the handler and its oposite the same proportion
- if(_pm().isBSpline()){
+ if(_pm().isBSpline(false)){
setPosition(_pm().BSplineHandleReposition(this,this));
this->other()->setPosition(_pm().BSplineHandleReposition(this->other(),this));
}
@@ -192,7 +192,7 @@ void Handle::move(Geom::Point const &new_pos)
setRelativePos(new_delta);
//move the handler and its oposite the same proportion
- if(_pm().isBSpline()){
+ if(_pm().isBSpline(false)){
setPosition(_pm().BSplineHandleReposition(this,this));
this->other()->setPosition(_pm().BSplineHandleReposition(this->other(),this));
}
@@ -218,7 +218,7 @@ void Handle::move(Geom::Point const &new_pos)
setPosition(new_pos);
// moves the handler and its oposite the same proportion
- if(_pm().isBSpline()){
+ if(_pm().isBSpline(false)){
setPosition(_pm().BSplineHandleReposition(this,this));
this->other()->setPosition(_pm().BSplineHandleReposition(this->other(),this));
}
@@ -313,7 +313,7 @@ bool Handle::_eventHandler(Inkscape::UI::Tools::ToolBase *event_context, GdkEven
//this function moves the handler and its oposite to the default proportion of defaultStartPower
void Handle::handle_2button_press(){
- if(_pm().isBSpline()){
+ if(_pm().isBSpline(false)){
setPosition(_pm().BSplineHandleReposition(this,defaultStartPower));
this->other()->setPosition(_pm().BSplineHandleReposition(this->other(),defaultStartPower));
_pm().update();
@@ -373,7 +373,7 @@ void Handle::dragged(Geom::Point &new_pos, GdkEventMotion *event)
new_pos = result;
// moves the handler and its oposite in X fixed positions depending on parameter "steps with control"
// by default in live BSpline
- if(_pm().isBSpline()){
+ if(_pm().isBSpline(false)){
setPosition(new_pos);
int steps = _pm().BSplineGetSteps();
new_pos=_pm().BSplineHandleReposition(this,ceilf(_pm().BSplineHandlePosition(this,this)*steps)/steps);
@@ -423,7 +423,7 @@ void Handle::dragged(Geom::Point &new_pos, GdkEventMotion *event)
}
}
//if it is bspline but SHIFT or CONTROL are not pressed it fixes it in the original position
- if(_pm().isBSpline() && !held_shift(*event) && !held_control(*event)){
+ if(_pm().isBSpline(false) && !held_shift(*event) && !held_control(*event)){
new_pos=_last_drag_origin();
}
move(new_pos); // needed for correct update, even though it's redundant
@@ -656,7 +656,7 @@ void Node::move(Geom::Point const &new_pos)
_fixNeighbors(old_pos, new_pos);
// move the affected handlers. First the node ones, later the adjoining ones.
- if(_pm().isBSpline()){
+ if(_pm().isBSpline(false)){
_front.setPosition(_pm().BSplineHandleReposition(this->front(),nodeWeight));
_back.setPosition(_pm().BSplineHandleReposition(this->back(),nodeWeight));
if(prevNode){
@@ -709,7 +709,7 @@ void Node::transform(Geom::Affine const &m)
_fixNeighbors(old_pos, position());
// move the involved handlers, first the node ones, later the adjoining ones
- if(_pm().isBSpline()){
+ if(_pm().isBSpline(false)){
_front.setPosition(_pm().BSplineHandleReposition(this->front(),nodeWeight));
_back.setPosition(_pm().BSplineHandleReposition(this->back(),nodeWeight));
if(prevNode){
@@ -916,7 +916,7 @@ void Node::setType(NodeType type, bool update_handles)
}
/* in node type changes, about bspline traces, we can mantain them with noPower power in border mode,
or we give them the default power in curve mode */
- if(_pm().isBSpline()){
+ if(_pm().isBSpline(false)){
double weight = noPower;
if(_pm().BSplineHandlePosition(this->front()) != noPower ){
weight = defaultStartPower;
@@ -1172,7 +1172,7 @@ void Node::_setState(State state)
mgr.setActive(_canvas_item, true);
mgr.setPrelight(_canvas_item, false);
//this shows the handlers when selecting the nodes
- if(_pm().isBSpline()){
+ if(_pm().isBSpline(false)){
this->front()->setPosition(_pm().BSplineHandleReposition(this->front()));
this->back()->setPosition(_pm().BSplineHandleReposition(this->back()));
}
diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp
index dbcde240a..64eba3921 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -670,7 +670,7 @@ unsigned PathManipulator::_deleteStretch(NodeList::iterator start, NodeList::ite
start = next;
}
// if we are removing, we readjust the handlers
- if(isBSpline()){
+ if(isBSpline(false)){
if(start.prev()){
start.prev()->front()->setPosition(BSplineHandleReposition(start.prev()->front(),start.prev()->back()));
}
@@ -999,7 +999,7 @@ NodeList::iterator PathManipulator::subdivideSegment(NodeList::iterator first, d
// set new handle positions
Node *n = new Node(_multi_path_manipulator._path_data.node_data, seg2[0]);
- if(!isBSpline()){
+ if(!isBSpline(false)){
n->back()->setPosition(seg1[2]);
n->front()->setPosition(seg2[1]);
n->setType(NODE_SMOOTH, false);
@@ -1245,7 +1245,7 @@ bool PathManipulator::isBSpline(bool recalculate){
return _is_bspline;
}
-bool PathManipulator::isBSpline() const {
+bool PathManipulator::isBSpline(false) const {
return BSplineGetSteps() > 0;
}
diff --git a/src/ui/tool/path-manipulator.h b/src/ui/tool/path-manipulator.h
index 4d2bf4300..4badec569 100644
--- a/src/ui/tool/path-manipulator.h
+++ b/src/ui/tool/path-manipulator.h
@@ -107,7 +107,7 @@ private:
void _createControlPointsFromGeometry();
- bool isBSpline(bool recalculate = false);
+ bool isBSpline(bool recalculate);
bool isBSpline() const;
double BSplineHandlePosition(Handle *h, Handle *h2 = NULL);
Geom::Point BSplineHandleReposition(Handle *h, Handle *h2 = NULL);