From 1512a076f4d28bd3f9b5eec084707b386ff964e6 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sun, 9 May 2010 21:02:14 +0200 Subject: Fix small snapping regression (reported in LP #562205, comment #11) (bzr r9405) --- src/ui/tool/node.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/ui/tool/node.cpp') diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index e9fa79fb3..56e0ecff8 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -1039,9 +1039,7 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) fp = bp; } fp.getPoint(new_pos); - if (fp.getTarget() != SNAPTARGET_CONSTRAINT) { - _desktop->snapindicator->set_new_snaptarget(fp); - } + _desktop->snapindicator->set_new_snaptarget(fp); } else { Geom::Point origin = _last_drag_origin(); Geom::Point delta = new_pos - origin; -- cgit v1.2.3 From 4c99f48a83a1a74ab46bfeaa841e88196165447a Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Wed, 26 May 2010 22:28:09 +0200 Subject: Consistency fix in the tools strings (badly places :). (bzr r9453) --- src/ui/tool/node.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/ui/tool/node.cpp') diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index 56e0ecff8..9c9c58ff1 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -357,21 +357,21 @@ Glib::ustring Handle::_getTip(unsigned state) } else { if (state_held_shift(state) && can_shift_rotate) { return C_("Path handle tip", - "Shift+Alt: preserve handle length and rotate both handles"); + "Shift+Alt: preserve handle length and rotate both handles"); } else { return C_("Path handle tip", - "Alt: preserve handle length while dragging"); + "Alt: preserve handle length while dragging"); } } } else { if (state_held_control(state)) { if (state_held_shift(state) && can_shift_rotate) { return format_tip(C_("Path handle tip", - "Shift+Ctrl: snap rotation angle to %g° increments and rotate both handles"), + "Shift+Ctrl: snap rotation angle to %g° increments and rotate both handles"), snap_increment_degrees()); } else { return format_tip(C_("Path handle tip", - "Ctrl: snap rotation angle to %g° increments, click to retract"), + "Ctrl: snap rotation angle to %g° increments, click to retract"), snap_increment_degrees()); } } else if (state_held_shift(state) && can_shift_rotate) { @@ -383,10 +383,10 @@ Glib::ustring Handle::_getTip(unsigned state) switch (_parent->type()) { case NODE_AUTO: return format_tip(C_("Path handle tip", - "Auto node handle: drag to convert to smooth node (%s)"), more); + "Auto node handle: drag to convert to smooth node (%s)"), more); default: return format_tip(C_("Path handle tip", - "%s: drag to shape the segment (%s)"), + "%s: drag to shape the segment (%s)"), handle_type_to_localized_string(_parent->type()), more); } } @@ -1141,21 +1141,21 @@ Glib::ustring Node::_getTip(unsigned state) "to %f° increments"), snap_increment_degrees()); }*/ return C_("Path node tip", - "Shift: drag out a handle, click to toggle selection"); + "Shift: drag out a handle, click to toggle selection"); } - return C_("Path node tip", "Shift: click to toggle selection"); + return C_("Path node tip", "Shift: click to toggle selection"); } if (state_held_control(state)) { if (state_held_alt(state)) { - return C_("Path node tip", "Ctrl+Alt: move along handle lines, click to delete node"); + return C_("Path node tip", "Ctrl+Alt: move along handle lines, click to delete node"); } return C_("Path node tip", - "Ctrl: move along axes, click to change node type"); + "Ctrl: move along axes, click to change node type"); } if (state_held_alt(state)) { - return C_("Path node tip", "Alt: sculpt nodes"); + return C_("Path node tip", "Alt: sculpt nodes"); } // No modifiers: assemble tip from node type @@ -1163,13 +1163,13 @@ Glib::ustring Node::_getTip(unsigned state) if (_selection.transformHandlesEnabled() && selected()) { if (_selection.size() == 1) { return format_tip(C_("Path node tip", - "%s: drag to shape the path (more: Shift, Ctrl, Alt)"), nodetype); + "%s: drag to shape the path (more: Shift, Ctrl, Alt)"), nodetype); } return format_tip(C_("Path node tip", - "%s: drag to shape the path, click to toggle scale/rotation handles (more: Shift, Ctrl, Alt)"), nodetype); + "%s: drag to shape the path, click to toggle scale/rotation handles (more: Shift, Ctrl, Alt)"), nodetype); } return format_tip(C_("Path node tip", - "%s: drag to shape the path, click to select only this node (more: Shift, Ctrl, Alt)"), nodetype); + "%s: drag to shape the path, click to select only this node (more: Shift, Ctrl, Alt)"), nodetype); } Glib::ustring Node::_getDragTip(GdkEventMotion */*event*/) -- cgit v1.2.3 From 35300c9822f9f84c8a011913235fd4e5dc2c5ac8 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Mon, 12 Jul 2010 07:51:13 +0200 Subject: - Snap while rotating an object using the selector tool - Rename the ConstraintLine class to SnapConstraint - Move some duplicated code to 2geom (bzr r9607) --- src/ui/tool/node.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/ui/tool/node.cpp') diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index 9c9c58ff1..886ddd1be 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -266,7 +266,7 @@ void Handle::dragged(Geom::Point &new_pos, GdkEventMotion *event) Node *node_away = (this == &_parent->_front ? _parent->_prev() : _parent->_next()); if (_parent->type() == NODE_SMOOTH && Node::_is_line_segment(_parent, node_away)) { - Inkscape::Snapper::ConstraintLine cl(_parent->position(), + Inkscape::Snapper::SnapConstraint cl(_parent->position(), _parent->position() - node_away->position()); Inkscape::SnappedPoint p; p = sm.constrainedSnap(Inkscape::SnapCandidatePoint(new_pos, SNAPSOURCE_NODE_HANDLE), cl); @@ -974,7 +974,7 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) // with Ctrl+Alt, constrain to handle lines // project the new position onto a handle line that is closer boost::optional front_point, back_point; - boost::optional line_front, line_back; + boost::optional line_front, line_back; if (_front.isDegenerate()) { if (_is_line_segment(this, _next())) front_point = _next()->position() - origin; @@ -988,9 +988,9 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) back_point = _back.relativePos(); } if (front_point) - line_front = Inkscape::Snapper::ConstraintLine(origin, *front_point); + line_front = Inkscape::Snapper::SnapConstraint(origin, *front_point); if (back_point) - line_back = Inkscape::Snapper::ConstraintLine(origin, *back_point); + line_back = Inkscape::Snapper::SnapConstraint(origin, *back_point); // TODO: combine the snap and non-snap branches by modifying snap.h / snap.cpp if (snap) { @@ -1029,8 +1029,8 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) // with Ctrl, constrain to axes // TODO combine the two branches if (snap) { - Inkscape::Snapper::ConstraintLine line_x(origin, Geom::Point(1, 0)); - Inkscape::Snapper::ConstraintLine line_y(origin, Geom::Point(0, 1)); + Inkscape::Snapper::SnapConstraint line_x(origin, Geom::Point(1, 0)); + Inkscape::Snapper::SnapConstraint line_y(origin, Geom::Point(0, 1)); fp = sm.constrainedSnap(Inkscape::SnapCandidatePoint(new_pos, _snapSourceType()), line_x); bp = sm.constrainedSnap(Inkscape::SnapCandidatePoint(new_pos, _snapSourceType()), line_y); } -- cgit v1.2.3