summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-03-23 14:55:27 +0000
committerJabiertxo Arraiza Zenotz <jtx@jtx.marker.es>2013-03-23 14:55:27 +0000
commitece108cd1302b59ac5f41a38b6bb377093348147 (patch)
tree7e0288ea4271b638c22c94c0eefe1b833504b0f5 /src/ui
parentEnabling Mesh (diff)
parentAdding mesh (diff)
downloadinkscape-ece108cd1302b59ac5f41a38b6bb377093348147.tar.gz
inkscape-ece108cd1302b59ac5f41a38b6bb377093348147.zip
Mauro based feedbak added some fixes
(bzr r11950.1.68)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/tool/node.cpp4
-rw-r--r--src/ui/tool/node.h1
-rw-r--r--src/ui/tool/path-manipulator.cpp23
-rw-r--r--src/ui/tool/path-manipulator.h2
4 files changed, 20 insertions, 10 deletions
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp
index 3e4fbd508..b4976bde5 100644
--- a/src/ui/tool/node.cpp
+++ b/src/ui/tool/node.cpp
@@ -389,7 +389,8 @@ void Handle::dragged(Geom::Point &new_pos, GdkEventMotion *event)
double pos = 0;
h = this;
setPosition(new_pos);
- pos = ceilf(_pm().BSplineHandlePosition(h)*_pm().controlBSplineSteps)/_pm().controlBSplineSteps;
+ int steps = _pm().getSteps();
+ pos = ceilf(_pm().BSplineHandlePosition(h)*steps)/steps;
new_pos=_pm().BSplineHandleReposition(h,pos);
}
//BSpline End
@@ -864,6 +865,7 @@ void Node::setType(NodeType type, bool update_handles)
Handle* front = &_front;
Handle* back = &_back;
double pos = _pm().BSplineHandlePosition(front);
+ if(pos !=0) pos = 0.3334;
_front.setPosition(_pm().BSplineHandleReposition(front,pos));
_back.setPosition(_pm().BSplineHandleReposition(back,pos));
}
diff --git a/src/ui/tool/node.h b/src/ui/tool/node.h
index af83ac54e..2b547256b 100644
--- a/src/ui/tool/node.h
+++ b/src/ui/tool/node.h
@@ -125,7 +125,6 @@ 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 8f6651dee..84e300306 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -161,7 +161,6 @@ PathManipulator::PathManipulator(MultiPathManipulator &mpm, SPPath *path,
isBSpline = false;
if(lpe_bsp){
isBSpline = true;
- controlBSplineSteps = lpe_bsp->steps+1;
}
//BSpline End
}
@@ -842,8 +841,12 @@ void PathManipulator::scaleHandle(Node *n, int which, int dir, bool pixel)
relpos *= ((rellen + length_change) / rellen);
}
h->setRelativePos(relpos);
- update();
+ if(isBSpline){
+ double pos = BSplineHandlePosition(h);
+ h->setPosition(BSplineHandleReposition(h,pos));
+ }
+ update();
gchar const *key = which < 0 ? "handle:scale:left" : "handle:scale:right";
_commit(_("Scale handle"), key);
}
@@ -867,7 +870,14 @@ void PathManipulator::rotateHandle(Node *n, int which, int dir, bool pixel)
}
h->setRelativePos(h->relativePos() * Geom::Rotate(angle));
+
+ if(isBSpline){
+ double pos = BSplineHandlePosition(h);
+ h->setPosition(BSplineHandleReposition(h,pos));
+ }
+
update();
+
gchar const *key = which < 0 ? "handle:rotate:left" : "handle:rotate:right";
_commit(_("Rotate handle"), key);
}
@@ -1200,12 +1210,11 @@ void PathManipulator::_createControlPointsFromGeometry()
}
}
+int PathManipulator::getSteps(){
+ return lpe_bsp->steps+1;
+}
+
double PathManipulator::BSplineHandlePosition(Handle *h){
- //BSpline
- if(lpe_bsp){
- controlBSplineSteps = lpe_bsp->steps+1;
- }
- //BSpline End
using Geom::X;
using Geom::Y;
double pos = 0;
diff --git a/src/ui/tool/path-manipulator.h b/src/ui/tool/path-manipulator.h
index 496bd957c..e68cabef1 100644
--- a/src/ui/tool/path-manipulator.h
+++ b/src/ui/tool/path-manipulator.h
@@ -99,7 +99,7 @@ public:
bool search_unselected, bool closest);
//BSpline
bool isBSpline;
- int controlBSplineSteps;
+ int getSteps();
//BSpline End
// this is necessary for Tab-selection in MultiPathManipulator
SubpathList &subpathList() { return _subpaths; }