summaryrefslogtreecommitdiffstats
path: root/src/ui/tool/curve-drag-point.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-07-24 18:50:50 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-07-24 18:50:50 +0000
commit93cbf2b74b58f8e327bf179cba8e778a4339a3a8 (patch)
treebdf4fd04d479bdcc5705579056372a1c8da2ff21 /src/ui/tool/curve-drag-point.cpp
parentupdate to trunk (diff)
parentFix a bug continuing a bezier path whith a LPE one like spiro or bspline on a... (diff)
downloadinkscape-93cbf2b74b58f8e327bf179cba8e778a4339a3a8.tar.gz
inkscape-93cbf2b74b58f8e327bf179cba8e778a4339a3a8.zip
update to trunk
(bzr r13682.1.27)
Diffstat (limited to 'src/ui/tool/curve-drag-point.cpp')
-rw-r--r--src/ui/tool/curve-drag-point.cpp29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/ui/tool/curve-drag-point.cpp b/src/ui/tool/curve-drag-point.cpp
index 23640456e..e460b0fb7 100644
--- a/src/ui/tool/curve-drag-point.cpp
+++ b/src/ui/tool/curve-drag-point.cpp
@@ -15,6 +15,8 @@
#include "ui/tool/multi-path-manipulator.h"
#include "ui/tool/path-manipulator.h"
#include "ui/tool/node.h"
+#include "sp-namedview.h"
+#include "snap.h"
namespace Inkscape {
namespace UI {
@@ -77,6 +79,16 @@ void CurveDragPoint::dragged(Geom::Point &new_pos, GdkEventMotion *event)
return;
}
+ if (_drag_initiated && !(event->state & GDK_SHIFT_MASK)) {
+ SnapManager &m = _desktop->namedview->snap_manager;
+ SPItem *path = static_cast<SPItem *>(_pm._path);
+ m.setup(_desktop, true, path); // We will not try to snap to "path" itself
+ Inkscape::SnapCandidatePoint scp(new_pos, Inkscape::SNAPSOURCE_OTHER_HANDLE);
+ Inkscape::SnappedPoint sp = m.freeSnap(scp, Geom::OptRect(), false);
+ new_pos = sp.getPoint();
+ m.unSetup();
+ }
+
// Magic Bezier Drag Equations follow!
// "weight" describes how the influence of the drag should be distributed
// among the handles; 0 = front handle only, 1 = back handle only.
@@ -166,14 +178,8 @@ void CurveDragPoint::_insertNode(bool take_selection)
// Otherwise clicks on the new node would only work after the user moves the mouse a bit.
// PathManipulator will restore visibility when necessary.
setVisible(false);
- NodeList::iterator inserted = _pm.subdivideSegment(first, _t);
- if (take_selection) {
- _pm._selection.clear();
- }
- _pm._selection.insert(inserted.ptr());
- _pm.update(true);
- _pm._commit(_("Add node"));
+ _pm.insertNode(first, _t, take_selection);
}
Glib::ustring CurveDragPoint::_getTip(unsigned state) const
@@ -181,6 +187,10 @@ Glib::ustring CurveDragPoint::_getTip(unsigned state) const
if (_pm.empty()) return "";
if (!first || !first.next()) return "";
bool linear = first->front()->isDegenerate() && first.next()->back()->isDegenerate();
+ if(state_held_shift(state) && _pm._isBSpline()){
+ return C_("Path segment tip",
+ "<b>Shift</b>: drag to open or move BSpline handles");
+ }
if (state_held_shift(state)) {
return C_("Path segment tip",
"<b>Shift</b>: click to toggle segment selection");
@@ -189,6 +199,11 @@ Glib::ustring CurveDragPoint::_getTip(unsigned state) const
return C_("Path segment tip",
"<b>Ctrl+Alt</b>: click to insert a node");
}
+ if(_pm._isBSpline()){
+ return C_("Path segment tip",
+ "<b>BSpline segment</b>: drag to shape the segment, doubleclick to insert node, "
+ "click to select (more: Shift, Ctrl+Alt)");
+ }
if (linear) {
return C_("Path segment tip",
"<b>Linear segment</b>: drag to convert to a Bezier segment, "