From 19117c36082531a00df461260f917d1207edde1f Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Wed, 11 Aug 2010 08:43:24 +0200 Subject: Clear pointers in the snapmanager if they're no longer needed. (bzr r9697) --- src/ui/tool/node.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/ui/tool') diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index a8582ccc5..4c8cc74d8 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -274,8 +274,10 @@ void Handle::dragged(Geom::Point &new_pos, GdkEventMotion *event) } else { sm.freeSnapReturnByRef(new_pos, SNAPSOURCE_NODE_HANDLE); } + sm.unSetup(); } + // with Shift, if the node is cusp, rotate the other handle as well if (_parent->type() == NODE_CUSP && !_drag_out) { if (held_shift(*event)) { -- cgit v1.2.3 From 5a7386ee9ff4f4194f39eff09de423e16229bf84 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Fri, 13 Aug 2010 23:03:59 +0200 Subject: Fix node editor crash when dragging near the last node of a path (bzr r9711) --- src/ui/tool/path-manipulator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/tool') diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index 66f72f379..8ce7a9e74 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -1414,7 +1414,7 @@ void PathManipulator::_updateDragPoint(Geom::Point const &evp) NodeList::iterator first = (*spi)->before(pvp->t, &fracpart); double stroke_tolerance = _getStrokeTolerance(); - if (Geom::distance(evp, nearest_point) < stroke_tolerance) { + if (first && first.next() && Geom::distance(evp, nearest_point) < stroke_tolerance) { _dragpoint->setVisible(true); _dragpoint->setPosition(_desktop->w2d(nearest_point)); _dragpoint->setSize(2 * stroke_tolerance); -- cgit v1.2.3 From 371f36456524bc0890df5594472b880c8e8828a2 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Fri, 13 Aug 2010 23:10:23 +0200 Subject: Fix funny behavior when dragging near the start node of a path (bzr r9712) --- src/ui/tool/path-manipulator.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ui/tool') diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index 8ce7a9e74..f5c27e1d6 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -1414,7 +1414,10 @@ void PathManipulator::_updateDragPoint(Geom::Point const &evp) NodeList::iterator first = (*spi)->before(pvp->t, &fracpart); double stroke_tolerance = _getStrokeTolerance(); - if (first && first.next() && Geom::distance(evp, nearest_point) < stroke_tolerance) { + if (first && first.next() && + fracpart != 0.0 && + Geom::distance(evp, nearest_point) < stroke_tolerance) + { _dragpoint->setVisible(true); _dragpoint->setPosition(_desktop->w2d(nearest_point)); _dragpoint->setSize(2 * stroke_tolerance); -- cgit v1.2.3 From f2bd49a175f20c29d6dd23b7380609dcfd7135c2 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sat, 14 Aug 2010 16:40:06 +0200 Subject: Fix a crash and add more safety checks to catch NULL pointers (bzr r9713) --- src/ui/tool/node.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/ui/tool') diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index 4c8cc74d8..f6fb6cc54 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -966,6 +966,11 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) } } sm.setupIgnoreSelection(_desktop, true, &unselected); + } else { + // even if we won't really snap, we might still call the one of the + // constrainedSnap() methods to enforce the constraints, so we need + // to setup the snapmanager anyway + sm.setup(_desktop); } if (held_control(*event)) { @@ -1029,6 +1034,8 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) new_pos = sp.getPoint(); } + sm.unSetup(); + SelectableControlPoint::dragged(new_pos, event); } -- cgit v1.2.3 From f624e4f24f6cc1a26552da5106f63ee4ae1fc57b Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sun, 15 Aug 2010 21:54:12 +0200 Subject: 2nd attempt at fixing the crash introduced in rev. #9692. This should nail it! (bzr r9714) --- src/ui/tool/node.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/tool') diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index f6fb6cc54..1070e4bc3 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -946,6 +946,7 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) SnapManager &sm = _desktop->namedview->snap_manager; bool snap = sm.someSnapperMightSnap(); Inkscape::SnappedPoint sp; + std::vector unselected; if (snap) { /* setup * TODO We are doing this every time a snap happens. It should once be done only once @@ -955,7 +956,6 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) * TODO Snapping to unselected segments of selected paths doesn't work yet. */ // Build the list of unselected nodes. - std::vector unselected; typedef ControlPointSelection::Set Set; Set &nodes = _selection.allPoints(); for (Set::iterator i = nodes.begin(); i != nodes.end(); ++i) { -- cgit v1.2.3 From e97b9eafcdbf2ac0034bca19e5e9c3297d438da3 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sat, 25 Sep 2010 11:04:23 +0200 Subject: fix snapmanager initialization Fixed bugs: - https://launchpad.net/bugs/630642 (bzr r9783) --- src/ui/tool/node.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/ui/tool') diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index 1070e4bc3..575a2f59e 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -944,7 +944,12 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) { // For a note on how snapping is implemented in Inkscape, see snap.h. SnapManager &sm = _desktop->namedview->snap_manager; + // even if we won't really snap, we might still call the one of the + // constrainedSnap() methods to enforce the constraints, so we need + // to setup the snapmanager anyway; this is also required for someSnapperMightSnap() + sm.setup(_desktop); bool snap = sm.someSnapperMightSnap(); + Inkscape::SnappedPoint sp; std::vector unselected; if (snap) { @@ -966,11 +971,6 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) } } sm.setupIgnoreSelection(_desktop, true, &unselected); - } else { - // even if we won't really snap, we might still call the one of the - // constrainedSnap() methods to enforce the constraints, so we need - // to setup the snapmanager anyway - sm.setup(_desktop); } if (held_control(*event)) { -- cgit v1.2.3 From 2b29b7a55f8e939d8588cfdc3fe26839da5e1357 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sat, 25 Sep 2010 11:29:21 +0200 Subject: Addition to my previous commit: fix for trunk is a bit different from the fix for v0.48 (bzr r9784) --- src/ui/tool/node.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/ui/tool') diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index 575a2f59e..a5952c9fb 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -970,6 +970,7 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) unselected.push_back(p); } } + sm.unSetup(); sm.setupIgnoreSelection(_desktop, true, &unselected); } -- cgit v1.2.3 From 285f551658271fde028b389f7b1abe35e65c6659 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 12 Oct 2010 18:11:17 +0200 Subject: Cherry pick node duplication from 0.48 stable (bzr r9825) --- src/ui/tool/multi-path-manipulator.cpp | 12 ++++++++++++ src/ui/tool/multi-path-manipulator.h | 1 + src/ui/tool/path-manipulator.cpp | 33 +++++++++++++++++++++++++++++++++ src/ui/tool/path-manipulator.h | 1 + 4 files changed, 47 insertions(+) (limited to 'src/ui/tool') diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index 2025a12d7..6101a3556 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -244,6 +244,12 @@ void MultiPathManipulator::insertNodes() _done(_("Add nodes")); } +void MultiPathManipulator::duplicateNodes() +{ + invokeForAll(&PathManipulator::duplicateNodes); + _done(_("Duplicate nodes")); +} + void MultiPathManipulator::joinNodes() { invokeForAll(&PathManipulator::hideDragPoint); @@ -513,6 +519,12 @@ bool MultiPathManipulator::event(GdkEvent *event) return true; } break; + case GDK_d: + case GDK_D: + if (held_only_shift(event->key)) { + duplicateNodes(); + return true; + } case GDK_j: case GDK_J: if (held_only_shift(event->key)) { diff --git a/src/ui/tool/multi-path-manipulator.h b/src/ui/tool/multi-path-manipulator.h index 181ae6d1d..7a4cfdb5d 100644 --- a/src/ui/tool/multi-path-manipulator.h +++ b/src/ui/tool/multi-path-manipulator.h @@ -53,6 +53,7 @@ public: void setSegmentType(SegmentType t); void insertNodes(); + void duplicateNodes(); void joinNodes(); void breakNodes(); void deleteNodes(bool keep_shape = true); diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index f5c27e1d6..81fc336ce 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -319,6 +319,39 @@ void PathManipulator::insertNodes() } } +/** Insert new nodes exactly at the positions of selected nodes while preserving shape. + * This is equivalent to breaking, except that it doesn't split into subpaths. */ +void PathManipulator::duplicateNodes() +{ + if (_num_selected == 0) return; + + for (SubpathList::iterator i = _subpaths.begin(); i != _subpaths.end(); ++i) { + for (NodeList::iterator j = (*i)->begin(); j != (*i)->end(); ++j) { + if (j->selected()) { + NodeList::iterator k = j.next(); + Node *n = new Node(_multi_path_manipulator._path_data.node_data, *j); + + // Move the new node to the bottom of the Z-order. This way you can drag all + // nodes that were selected before this operation without deselecting + // everything because there is a new node above. + n->sink(); + + n->front()->setPosition(*j->front()); + j->front()->retract(); + j->setType(NODE_CUSP, false); + (*i)->insert(k, n); + + // We need to manually call the selection change callback to refresh + // the handle display correctly. + // This call changes num_selected, but we call this once for a selected node + // and once for an unselected node, so in the end the number stays correct. + _selectionChanged(j.ptr(), true); + _selectionChanged(n, false); + } + } + } +} + /** Replace contiguous selections of nodes in each subpath with one node. */ void PathManipulator::weldNodes(NodeList::iterator preserve_pos) { diff --git a/src/ui/tool/path-manipulator.h b/src/ui/tool/path-manipulator.h index a8f1c957e..c57b6497e 100644 --- a/src/ui/tool/path-manipulator.h +++ b/src/ui/tool/path-manipulator.h @@ -69,6 +69,7 @@ public: void invertSelectionInSubpaths(); void insertNodes(); + void duplicateNodes(); void weldNodes(NodeList::iterator preserve_pos = NodeList::iterator()); void weldSegments(); void breakNodes(); -- cgit v1.2.3 From f827618fbfb446bcd954281fd46b5e88090590cf Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 12 Oct 2010 18:22:08 +0200 Subject: Fix oddities related to smooth endnodes. Should fix a crasher. (bzr r9826) --- src/ui/tool/node.cpp | 6 ++++-- src/ui/tool/path-manipulator.cpp | 12 +++--------- 2 files changed, 7 insertions(+), 11 deletions(-) (limited to 'src/ui/tool') diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index a5952c9fb..7efb6a5dc 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -580,13 +580,15 @@ void Node::setType(NodeType type, bool update_handles) _updateAutoHandles(); break; case NODE_SMOOTH: { + // ignore attempts to make smooth endnodes. + if (isEndNode()) return; // rotate handles to be colinear // for degenerate nodes set positions like auto handles bool prev_line = _is_line_segment(_prev(), this); bool next_line = _is_line_segment(this, _next()); if (_type == NODE_SMOOTH) { - // for a node that is already smooth and has a degenerate handle, - // drag out the second handle to 1/3 the length of the linear segment + // For a node that is already smooth and has a degenerate handle, + // drag out the second handle without changing the direction of the first one. if (_front.isDegenerate()) { double dist = Geom::distance(_next()->position(), position()); _front.setRelativePos(Geom::unit_vector(-_back.relativePos()) * dist / 3); diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index 81fc336ce..41be81d4f 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -1325,17 +1325,11 @@ bool PathManipulator::_nodeClicked(Node *n, GdkEventButton *event) return true; } else if (held_control(*event)) { // Ctrl+click: cycle between node types - if (n->isEndNode()) { - if (n->type() == NODE_CUSP) { - n->setType(NODE_SMOOTH); - } else { - n->setType(NODE_CUSP); - } - } else { + if (!n->isEndNode()) { n->setType(static_cast((n->type() + 1) % NODE_LAST_REAL_TYPE)); + update(); + _commit(_("Cycle node type")); } - update(); - _commit(_("Cycle node type")); return true; } return false; -- cgit v1.2.3 From 9506eb893b0a00f957624653388e2faad41cbcb8 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 12 Oct 2010 18:23:52 +0200 Subject: Remove the misfeature of retracting handles when the cusp node button is clicked and there are cusp nodes selected. It's really annoying when you have both smooth and cusp nodes in a selection. Use segment commands and Ctrl+click to retract handles instead. (bzr r9827) --- src/ui/tool/node.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/ui/tool') diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index 7efb6a5dc..399fa5292 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -569,10 +569,13 @@ void Node::setType(NodeType type, bool update_handles) switch (type) { case NODE_CUSP: // if the existing type is also NODE_CUSP, retract handles - if (_type == NODE_CUSP) { - _front.retract(); - _back.retract(); - } + // NOTE: This misfeature is very annoying when you have both cusp and smooth + // nodes in a selection, so I have removed it. Use segment commands + // or Ctrl+click to retract handles. + //if (_type == NODE_CUSP) { + // _front.retract(); + // _back.retract(); + //} break; case NODE_AUTO: // auto handles make no sense for endnodes -- cgit v1.2.3 From 79286f0636cf258c4dcf0b465b6c1445ce0124cb Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 31 Oct 2010 19:26:58 +0100 Subject: Fix pattern editing in the node editor. As a bonus, allow editing of more than one non-path shape at once. (bzr r9867) --- src/ui/tool/node-tool.cpp | 25 +++++++++++++------------ src/ui/tool/node-tool.h | 3 +++ 2 files changed, 16 insertions(+), 12 deletions(-) (limited to 'src/ui/tool') diff --git a/src/ui/tool/node-tool.cpp b/src/ui/tool/node-tool.cpp index 450ca96f0..f2b2426ae 100644 --- a/src/ui/tool/node-tool.cpp +++ b/src/ui/tool/node-tool.cpp @@ -164,6 +164,7 @@ void ink_node_tool_init(InkNodeTool *nt) new (&nt->_multipath) MultiPathPtr(); new (&nt->_selector) SelectorPtr(); new (&nt->_path_data) PathSharedDataPtr(); + new (&nt->_shape_editors) ShapeEditors(); } void ink_node_tool_dispose(GObject *object) @@ -178,6 +179,7 @@ void ink_node_tool_dispose(GObject *object) nt->_multipath.~MultiPathPtr(); nt->_selected_nodes.~CSelPtr(); nt->_selector.~SelectorPtr(); + nt->_shape_editors.~ShapeEditors(); Inkscape::UI::PathSharedData &data = *nt->_path_data; destroy_group(data.node_data.node_group); @@ -283,7 +285,7 @@ void ink_node_tool_setup(SPEventContext *ec) nt->_last_over = NULL; // TODO long term, fold ShapeEditor into MultiPathManipulator and rename MPM // to something better - nt->shape_editor = new ShapeEditor(nt->desktop); + //nt->shape_editor = new ShapeEditor(nt->desktop); // read prefs before adding items to selection to prevent momentarily showing the outline sp_event_context_read(nt, "show_handles"); @@ -403,22 +405,21 @@ void ink_node_tool_selection_changed(InkNodeTool *nt, Inkscape::Selection *sel) } } - // ugly hack: set the first editable non-path item for knotholder - // maybe use multiple ShapeEditors for now, to allow editing many shapes at once? - bool something_set = false; + nt->_shape_editors.clear(); + + // use multiple ShapeEditors for now, to allow editing many shapes at once + // needs to be rethought + for (std::set::iterator i = shapes.begin(); i != shapes.end(); ++i) { ShapeRecord const &r = *i; - if (SP_IS_SHAPE(r.item) || - (SP_IS_PATH(r.item) && r.item->repr->attribute("inkscape:original-d") != NULL)) + if (SP_IS_SHAPE(r.item)) { - nt->shape_editor->set_item(r.item, SH_KNOTHOLDER); - something_set = true; - break; + ShapeEditor *si = new ShapeEditor(nt->desktop); + si->set_item(r.item, SH_KNOTHOLDER); + nt->_shape_editors.push_back(si); + //nt->shape_editor->set_item(r.item, SH_KNOTHOLDER); } } - if (!something_set) { - nt->shape_editor->unset_item(SH_KNOTHOLDER); - } nt->_multipath->setItems(shapes); ink_node_tool_update_tip(nt, NULL); diff --git a/src/ui/tool/node-tool.h b/src/ui/tool/node-tool.h index 641d064c1..11652b535 100644 --- a/src/ui/tool/node-tool.h +++ b/src/ui/tool/node-tool.h @@ -12,6 +12,7 @@ #define SEEN_UI_TOOL_NODE_TOOL_H #include +#include #include #include #include "event-context.h" @@ -41,6 +42,7 @@ typedef std::auto_ptr MultiPathPtr; typedef std::auto_ptr CSelPtr; typedef std::auto_ptr SelectorPtr; typedef std::auto_ptr PathSharedDataPtr; +typedef boost::ptr_vector ShapeEditors; struct InkNodeTool : public SPEventContext { @@ -56,6 +58,7 @@ struct InkNodeTool : public SPEventContext PathSharedDataPtr _path_data; SPCanvasGroup *_transform_handle_group; SPItem *_last_over; + ShapeEditors _shape_editors; unsigned cursor_drag : 1; unsigned show_handles : 1; -- cgit v1.2.3 From af4950e7c9ceb863e8daba3928eca71e33234dae Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 31 Oct 2010 22:22:56 +0100 Subject: Only create / delete shape editors in the node tool when necessary. (bzr r9868) --- src/ui/tool/node-tool.cpp | 27 +++++++++++++++------------ src/ui/tool/node-tool.h | 4 ++-- 2 files changed, 17 insertions(+), 14 deletions(-) (limited to 'src/ui/tool') diff --git a/src/ui/tool/node-tool.cpp b/src/ui/tool/node-tool.cpp index f2b2426ae..b573ff3e3 100644 --- a/src/ui/tool/node-tool.cpp +++ b/src/ui/tool/node-tool.cpp @@ -25,6 +25,7 @@ #include "sp-mask.h" #include "sp-object-group.h" #include "sp-path.h" +#include "sp-text.h" #include "ui/tool/node-tool.h" #include "ui/tool/control-point-selection.h" #include "ui/tool/curve-drag-point.h" @@ -197,10 +198,6 @@ void ink_node_tool_dispose(GObject *object) if (nt->_node_message_context) { delete nt->_node_message_context; } - if (nt->shape_editor) { - nt->shape_editor->unset_item(SH_KNOTHOLDER); - delete nt->shape_editor; - } G_OBJECT_CLASS(g_type_class_peek(g_type_parent(INK_TYPE_NODE_TOOL)))->dispose(object); } @@ -283,9 +280,6 @@ void ink_node_tool_setup(SPEventContext *ec) nt->flash_tempitem = NULL; nt->flashed_item = NULL; nt->_last_over = NULL; - // TODO long term, fold ShapeEditor into MultiPathManipulator and rename MPM - // to something better - //nt->shape_editor = new ShapeEditor(nt->desktop); // read prefs before adding items to selection to prevent momentarily showing the outline sp_event_context_read(nt, "show_handles"); @@ -405,19 +399,28 @@ void ink_node_tool_selection_changed(InkNodeTool *nt, Inkscape::Selection *sel) } } - nt->_shape_editors.clear(); - // use multiple ShapeEditors for now, to allow editing many shapes at once // needs to be rethought + for (ShapeEditors::iterator i = nt->_shape_editors.begin(); + i != nt->_shape_editors.end(); ) + { + ShapeRecord s; + s.item = i->first; + if (shapes.find(s) == shapes.end()) { + nt->_shape_editors.erase(i++); + } else { + ++i; + } + } for (std::set::iterator i = shapes.begin(); i != shapes.end(); ++i) { ShapeRecord const &r = *i; - if (SP_IS_SHAPE(r.item)) + if ((SP_IS_SHAPE(r.item) || SP_IS_TEXT(r.item)) && + nt->_shape_editors.find(r.item) == nt->_shape_editors.end()) { ShapeEditor *si = new ShapeEditor(nt->desktop); si->set_item(r.item, SH_KNOTHOLDER); - nt->_shape_editors.push_back(si); - //nt->shape_editor->set_item(r.item, SH_KNOTHOLDER); + nt->_shape_editors.insert(const_cast(r.item), si); } } diff --git a/src/ui/tool/node-tool.h b/src/ui/tool/node-tool.h index 11652b535..39d04a183 100644 --- a/src/ui/tool/node-tool.h +++ b/src/ui/tool/node-tool.h @@ -12,7 +12,7 @@ #define SEEN_UI_TOOL_NODE_TOOL_H #include -#include +#include #include #include #include "event-context.h" @@ -42,7 +42,7 @@ typedef std::auto_ptr MultiPathPtr; typedef std::auto_ptr CSelPtr; typedef std::auto_ptr SelectorPtr; typedef std::auto_ptr PathSharedDataPtr; -typedef boost::ptr_vector ShapeEditors; +typedef boost::ptr_map ShapeEditors; struct InkNodeTool : public SPEventContext { -- cgit v1.2.3 From 75caaff0d0141c063f4592abaf36e8853f54e37c Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Mon, 1 Nov 2010 00:17:32 +0100 Subject: Prevent context menu and keyboard shortcuts from interrupting grabs (bzr r9869) --- src/ui/tool/control-point.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/ui/tool') diff --git a/src/ui/tool/control-point.cpp b/src/ui/tool/control-point.cpp index b74e3bc9c..28c679985 100644 --- a/src/ui/tool/control-point.cpp +++ b/src/ui/tool/control-point.cpp @@ -329,7 +329,7 @@ bool ControlPoint::_eventHandler(GdkEvent *event) _setState(STATE_CLICKED); return true; } - return false; + return _event_grab; case GDK_2BUTTON_PRESS: // store the button number for next release @@ -452,8 +452,9 @@ bool ControlPoint::_eventHandler(GdkEvent *event) default: break; } - - return false; + + // do not propagate events during grab - it might cause problems + return _event_grab; } void ControlPoint::_setMouseover(ControlPoint *p, unsigned state) -- cgit v1.2.3 From c8c9ae21902c8603dd80be90d0b3b7851eef816d Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 7 Nov 2010 00:09:40 +0100 Subject: Reintroduce Shift+L shortcut and handle retraction when setting the type of already cusp nodes to cusp in the node tool (bzr r9875) --- src/ui/tool/multi-path-manipulator.cpp | 29 +++++++++++++++++++++++++++-- src/ui/tool/node.cpp | 9 +-------- 2 files changed, 28 insertions(+), 10 deletions(-) (limited to 'src/ui/tool') diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index 6101a3556..a1b398bb1 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -220,11 +220,29 @@ void MultiPathManipulator::invertSelectionInSubpaths() void MultiPathManipulator::setNodeType(NodeType type) { if (_selection.empty()) return; + + // When all selected nodes are already cusp, retract their handles + bool retract_handles = (type == NODE_CUSP); + for (ControlPointSelection::iterator i = _selection.begin(); i != _selection.end(); ++i) { Node *node = dynamic_cast(*i); - if (node) node->setType(type); + if (node) { + retract_handles &= (node->type() == NODE_CUSP); + node->setType(type); + } } - _done(_("Change node type")); + + if (retract_handles) { + for (ControlPointSelection::iterator i = _selection.begin(); i != _selection.end(); ++i) { + Node *node = dynamic_cast(*i); + if (node) { + node->front()->retract(); + node->back()->retract(); + } + } + } + + _done(retract_handles ? _("Retract handles") : _("Change node type")); } void MultiPathManipulator::setSegmentType(SegmentType type) @@ -603,6 +621,13 @@ bool MultiPathManipulator::event(GdkEvent *event) return true; } break; + case GDK_l: + case GDK_L: + if (held_only_shift(event->key)) { + // Shift+L - make segments linear + setSegmentType(SEGMENT_LINEAR); + return true; + } default: break; } diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index 399fa5292..60b5812c6 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -568,14 +568,7 @@ void Node::setType(NodeType type, bool update_handles) if (update_handles) { switch (type) { case NODE_CUSP: - // if the existing type is also NODE_CUSP, retract handles - // NOTE: This misfeature is very annoying when you have both cusp and smooth - // nodes in a selection, so I have removed it. Use segment commands - // or Ctrl+click to retract handles. - //if (_type == NODE_CUSP) { - // _front.retract(); - // _back.retract(); - //} + // nothing to do break; case NODE_AUTO: // auto handles make no sense for endnodes -- cgit v1.2.3 From 500120c0ac96cb218bfe240150831e9d6826fe76 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sun, 7 Nov 2010 01:01:55 -0800 Subject: Fix compile breakage. (bzr r9876) --- src/ui/tool/multi-path-manipulator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/tool') diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index a1b398bb1..494a81a8d 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -625,7 +625,7 @@ bool MultiPathManipulator::event(GdkEvent *event) case GDK_L: if (held_only_shift(event->key)) { // Shift+L - make segments linear - setSegmentType(SEGMENT_LINEAR); + setSegmentType(SEGMENT_STRAIGHT); return true; } default: -- cgit v1.2.3 From 1bf617cedfbc6399c41c423d1bae39f5a06ad2a1 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 7 Nov 2010 22:15:48 +0100 Subject: Reintroduce Shift+U shortcut (make segments curves) (bzr r9881) --- src/ui/tool/multi-path-manipulator.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/ui/tool') diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index 494a81a8d..a85e85217 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -628,6 +628,13 @@ bool MultiPathManipulator::event(GdkEvent *event) setSegmentType(SEGMENT_STRAIGHT); return true; } + case GDK_u: + case GDK_U: + if (held_only_shift(event->key)) { + // Shift+L - make segments curves + setSegmentType(SEGMENT_CUBIC_BEZIER); + return true; + } default: break; } -- cgit v1.2.3 From 144819c918dc761641c3cb5a490205fb73194ee3 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Wed, 17 Nov 2010 13:12:56 +1100 Subject: Super duper mega (fun!) commit: replaced encoding=utf-8 with fileencoding=utf-8 in all 1074 Vim modelines. The reason for this is that (a) setting the encoding isn't nice, and (b) Vim 7.3 (with modeline enabled) disallows it and pops up an error whenever you open any file with it ("invalid modeline"). Also corrected five deviant modestrings: * src/ui/widget/dock.cpp and src/ui/widget/dock.h: missing colon at the end * src/ui/dialog/tile.cpp: removed gratuitous second colon at the end * src/helper/units-test.h: removed gratuitous space before a colon * share/extensions/export_gimp_palette.py: missing textwidth=99 That's my geekiest commit yet. (bzr r9900) --- src/ui/tool/commit-events.h | 2 +- src/ui/tool/control-point-selection.cpp | 2 +- src/ui/tool/control-point-selection.h | 2 +- src/ui/tool/control-point.cpp | 2 +- src/ui/tool/control-point.h | 2 +- src/ui/tool/curve-drag-point.cpp | 2 +- src/ui/tool/curve-drag-point.h | 2 +- src/ui/tool/event-utils.cpp | 2 +- src/ui/tool/event-utils.h | 2 +- src/ui/tool/manipulator.cpp | 2 +- src/ui/tool/manipulator.h | 2 +- src/ui/tool/modifier-tracker.cpp | 2 +- src/ui/tool/modifier-tracker.h | 2 +- src/ui/tool/multi-path-manipulator.cpp | 2 +- src/ui/tool/multi-path-manipulator.h | 2 +- src/ui/tool/node-tool.cpp | 2 +- src/ui/tool/node-tool.h | 2 +- src/ui/tool/node-types.h | 2 +- src/ui/tool/node.cpp | 2 +- src/ui/tool/node.h | 2 +- src/ui/tool/path-manipulator.cpp | 2 +- src/ui/tool/path-manipulator.h | 2 +- src/ui/tool/selectable-control-point.cpp | 2 +- src/ui/tool/selectable-control-point.h | 2 +- src/ui/tool/selector.cpp | 2 +- src/ui/tool/selector.h | 2 +- src/ui/tool/shape-record.h | 2 +- src/ui/tool/transform-handle-set.cpp | 2 +- src/ui/tool/transform-handle-set.h | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) (limited to 'src/ui/tool') diff --git a/src/ui/tool/commit-events.h b/src/ui/tool/commit-events.h index d99872766..110564ba3 100644 --- a/src/ui/tool/commit-events.h +++ b/src/ui/tool/commit-events.h @@ -48,4 +48,4 @@ enum CommitEvent { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/control-point-selection.cpp b/src/ui/tool/control-point-selection.cpp index 615587eeb..91e0bc2c2 100644 --- a/src/ui/tool/control-point-selection.cpp +++ b/src/ui/tool/control-point-selection.cpp @@ -654,4 +654,4 @@ bool ControlPointSelection::event(GdkEvent *event) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/control-point-selection.h b/src/ui/tool/control-point-selection.h index 8023c3e28..3aed6ae93 100644 --- a/src/ui/tool/control-point-selection.h +++ b/src/ui/tool/control-point-selection.h @@ -159,4 +159,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/control-point.cpp b/src/ui/tool/control-point.cpp index 28c679985..d5e5b7dfe 100644 --- a/src/ui/tool/control-point.cpp +++ b/src/ui/tool/control-point.cpp @@ -579,4 +579,4 @@ bool ControlPoint::doubleclicked(GdkEventButton *) { return false; } fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/control-point.h b/src/ui/tool/control-point.h index 48c70748b..4de5e5847 100644 --- a/src/ui/tool/control-point.h +++ b/src/ui/tool/control-point.h @@ -199,4 +199,4 @@ extern ControlPoint::ColorSet invisible_cset; fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/curve-drag-point.cpp b/src/ui/tool/curve-drag-point.cpp index 0e5805dda..a3fb5aa6e 100644 --- a/src/ui/tool/curve-drag-point.cpp +++ b/src/ui/tool/curve-drag-point.cpp @@ -193,4 +193,4 @@ Glib::ustring CurveDragPoint::_getTip(unsigned state) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/curve-drag-point.h b/src/ui/tool/curve-drag-point.h index 288ae6a8e..42a4930c8 100644 --- a/src/ui/tool/curve-drag-point.h +++ b/src/ui/tool/curve-drag-point.h @@ -59,4 +59,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/event-utils.cpp b/src/ui/tool/event-utils.cpp index 91b2cdb04..ef2d27653 100644 --- a/src/ui/tool/event-utils.cpp +++ b/src/ui/tool/event-utils.cpp @@ -153,4 +153,4 @@ unsigned state_after_event(GdkEvent *event) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/event-utils.h b/src/ui/tool/event-utils.h index 784855f56..de29c3dda 100644 --- a/src/ui/tool/event-utils.h +++ b/src/ui/tool/event-utils.h @@ -129,4 +129,4 @@ unsigned state_after_event(GdkEvent *event); fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/manipulator.cpp b/src/ui/tool/manipulator.cpp index b532fcab4..49e601797 100644 --- a/src/ui/tool/manipulator.cpp +++ b/src/ui/tool/manipulator.cpp @@ -86,4 +86,4 @@ bool ManipulatorGroup::event(GdkEvent *event) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/manipulator.h b/src/ui/tool/manipulator.h index 799dad0d3..fd24e7b61 100644 --- a/src/ui/tool/manipulator.h +++ b/src/ui/tool/manipulator.h @@ -162,4 +162,4 @@ protected: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/modifier-tracker.cpp b/src/ui/tool/modifier-tracker.cpp index 8c6033bc7..bbef0d469 100644 --- a/src/ui/tool/modifier-tracker.cpp +++ b/src/ui/tool/modifier-tracker.cpp @@ -90,4 +90,4 @@ bool ModifierTracker::event(GdkEvent *event) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/modifier-tracker.h b/src/ui/tool/modifier-tracker.h index 55538ead6..8c8787e87 100644 --- a/src/ui/tool/modifier-tracker.h +++ b/src/ui/tool/modifier-tracker.h @@ -51,4 +51,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index a85e85217..82446b7b4 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -758,4 +758,4 @@ guint32 MultiPathManipulator::_getOutlineColor(ShapeRole role) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/multi-path-manipulator.h b/src/ui/tool/multi-path-manipulator.h index 7a4cfdb5d..ddb74c1bc 100644 --- a/src/ui/tool/multi-path-manipulator.h +++ b/src/ui/tool/multi-path-manipulator.h @@ -136,4 +136,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/node-tool.cpp b/src/ui/tool/node-tool.cpp index b573ff3e3..57e57b711 100644 --- a/src/ui/tool/node-tool.cpp +++ b/src/ui/tool/node-tool.cpp @@ -662,4 +662,4 @@ void ink_node_tool_mouseover_changed(InkNodeTool *nt, Inkscape::UI::ControlPoint fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/node-tool.h b/src/ui/tool/node-tool.h index 39d04a183..4d38e69e2 100644 --- a/src/ui/tool/node-tool.h +++ b/src/ui/tool/node-tool.h @@ -89,4 +89,4 @@ GType ink_node_tool_get_type (void); fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/node-types.h b/src/ui/tool/node-types.h index 80eaf4fa7..e4921fa8d 100644 --- a/src/ui/tool/node-types.h +++ b/src/ui/tool/node-types.h @@ -45,4 +45,4 @@ enum SegmentType { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index 60b5812c6..9ab495488 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -1382,4 +1382,4 @@ NodeList &NodeList::get(iterator const &i) { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/node.h b/src/ui/tool/node.h index af4cd7e3a..0194f5053 100644 --- a/src/ui/tool/node.h +++ b/src/ui/tool/node.h @@ -408,4 +408,4 @@ NodeIterator &NodeIterator::retreat() { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index 41be81d4f..956f48a7d 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -1489,4 +1489,4 @@ double PathManipulator::_getStrokeTolerance() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/path-manipulator.h b/src/ui/tool/path-manipulator.h index c57b6497e..87b88fc77 100644 --- a/src/ui/tool/path-manipulator.h +++ b/src/ui/tool/path-manipulator.h @@ -163,4 +163,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/selectable-control-point.cpp b/src/ui/tool/selectable-control-point.cpp index 76028dd82..e9a8bcbd6 100644 --- a/src/ui/tool/selectable-control-point.cpp +++ b/src/ui/tool/selectable-control-point.cpp @@ -136,4 +136,4 @@ void SelectableControlPoint::_setState(State state) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/selectable-control-point.h b/src/ui/tool/selectable-control-point.h index 2fde16ea9..1b8bd46cc 100644 --- a/src/ui/tool/selectable-control-point.h +++ b/src/ui/tool/selectable-control-point.h @@ -69,4 +69,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/selector.cpp b/src/ui/tool/selector.cpp index d766d5be3..fdd0fc51f 100644 --- a/src/ui/tool/selector.cpp +++ b/src/ui/tool/selector.cpp @@ -130,4 +130,4 @@ bool Selector::event(GdkEvent *event) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/selector.h b/src/ui/tool/selector.h index f7c00ea71..e61668d9e 100644 --- a/src/ui/tool/selector.h +++ b/src/ui/tool/selector.h @@ -56,4 +56,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/shape-record.h b/src/ui/tool/shape-record.h index edfad1401..893231404 100644 --- a/src/ui/tool/shape-record.h +++ b/src/ui/tool/shape-record.h @@ -58,4 +58,4 @@ struct ShapeRecord : fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/transform-handle-set.cpp b/src/ui/tool/transform-handle-set.cpp index 6b8fb4c11..ef93a3767 100644 --- a/src/ui/tool/transform-handle-set.cpp +++ b/src/ui/tool/transform-handle-set.cpp @@ -654,4 +654,4 @@ void TransformHandleSet::_updateVisibility(bool v) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/transform-handle-set.h b/src/ui/tool/transform-handle-set.h index 48ad3af51..2a4df8751 100644 --- a/src/ui/tool/transform-handle-set.h +++ b/src/ui/tool/transform-handle-set.h @@ -93,4 +93,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : -- cgit v1.2.3 From a6ba6ad5e29d23ba866e4d8bda61b4f18e053ba1 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Wed, 17 Nov 2010 22:17:44 +0100 Subject: Shift should disable snapping when dragging the rotation center of an object (bzr r9903) --- src/ui/tool/node.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ui/tool') diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index 9ab495488..6460d9062 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -1020,12 +1020,12 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) constraints.push_back(Inkscape::Snapper::SnapConstraint(origin, *bperp_point)); } - sp = sm.multipleConstrainedSnaps(Inkscape::SnapCandidatePoint(new_pos, _snapSourceType()), constraints); + sp = sm.multipleConstrainedSnaps(Inkscape::SnapCandidatePoint(new_pos, _snapSourceType()), constraints, held_shift(*event)); } else { // with Ctrl, constrain to axes constraints.push_back(Inkscape::Snapper::SnapConstraint(origin, Geom::Point(1, 0))); constraints.push_back(Inkscape::Snapper::SnapConstraint(origin, Geom::Point(0, 1))); - sp = sm.multipleConstrainedSnaps(Inkscape::SnapCandidatePoint(new_pos, _snapSourceType()), constraints); + sp = sm.multipleConstrainedSnaps(Inkscape::SnapCandidatePoint(new_pos, _snapSourceType()), constraints, held_shift(*event)); } new_pos = sp.getPoint(); } else if (snap) { -- cgit v1.2.3 From a6d9d1d88e4a31033d0a96bf2d9f7e93cbdf4534 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Thu, 18 Nov 2010 19:10:22 +0100 Subject: Fix four minor node tool regressions: * Inverted modifier for spatial/linear grow * PgDn/PgUp keyboard shortcuts for grow * Shift during drag disables snapping * Clicking on the background deselects first the nodes and then the path Fixed bugs: - https://launchpad.net/bugs/647498 - https://launchpad.net/bugs/588628 (bzr r9904) --- src/ui/tool/node-tool.cpp | 10 ++++++++-- src/ui/tool/node.cpp | 29 +++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 6 deletions(-) (limited to 'src/ui/tool') diff --git a/src/ui/tool/node-tool.cpp b/src/ui/tool/node-tool.cpp index 57e57b711..8008d79eb 100644 --- a/src/ui/tool/node-tool.cpp +++ b/src/ui/tool/node-tool.cpp @@ -619,8 +619,14 @@ void ink_node_tool_select_point(InkNodeTool *nt, Geom::Point const &/*sel*/, Gdk if (item_clicked == NULL) { // nothing under cursor // if no Shift, deselect - if (!(event->state & GDK_SHIFT_MASK)) { - selection->clear(); + // if there are nodes selected, the first click should deselect the nodes + // and the second should deselect the items + if (!state_held_shift(event->state)) { + if (nt->_selected_nodes->empty()) { + selection->clear(); + } else { + nt->_selected_nodes->clear(); + } } } else { if (held_shift(*event)) { diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index 6460d9062..12d04dd2b 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -728,8 +728,7 @@ NodeType Node::parse_nodetype(char x) /** Customized event handler to catch scroll events needed for selection grow/shrink. */ bool Node::_eventHandler(GdkEvent *event) { - static NodeList::iterator origin; - static int dir; + int dir = 0; switch (event->type) { @@ -740,14 +739,34 @@ bool Node::_eventHandler(GdkEvent *event) dir = -1; } else break; if (held_control(event->scroll)) { - _selection.spatialGrow(this, dir); + _linearGrow(dir); } else { + _selection.spatialGrow(this, dir); + } + return true; + case GDK_KEY_PRESS: + switch (shortcut_key(event->key)) + { + case GDK_Page_Up: + dir = 1; + break; + case GDK_Page_Down: + dir = -1; + break; + default: goto bail_out; + } + + if (held_control(event->key)) { _linearGrow(dir); + } else { + _selection.spatialGrow(this, dir); } return true; default: break; } + + bail_out: return ControlPoint::_eventHandler(event); } @@ -946,7 +965,9 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) // constrainedSnap() methods to enforce the constraints, so we need // to setup the snapmanager anyway; this is also required for someSnapperMightSnap() sm.setup(_desktop); - bool snap = sm.someSnapperMightSnap(); + + // do not snap when Shift is pressed + bool snap = !held_shift(*event) && sm.someSnapperMightSnap(); Inkscape::SnappedPoint sp; std::vector unselected; -- cgit v1.2.3