From 70829da1b189d6d8f07f12d97b9273d56dbd789e Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 17 Apr 2011 14:51:06 +0200 Subject: add new preference widget for a number with a unit. change Preferences > Steps to this new widget (bzr r10177) --- src/ui/tool/control-point-selection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ui/tool/control-point-selection.cpp') diff --git a/src/ui/tool/control-point-selection.cpp b/src/ui/tool/control-point-selection.cpp index 1fb98d78f..13da4a712 100644 --- a/src/ui/tool/control-point-selection.cpp +++ b/src/ui/tool/control-point-selection.cpp @@ -432,7 +432,7 @@ bool ControlPointSelection::_keyboardMove(GdkEventKey const &event, Geom::Point delta /= _desktop->current_zoom(); } else { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - double nudge = prefs->getDoubleLimited("/options/nudgedistance/value", 2, 0, 1000); + double nudge = prefs->getDoubleLimited("/options/nudgedistance/value", 2, 0, 1000, "px"); delta *= nudge; } @@ -533,7 +533,7 @@ bool ControlPointSelection::_keyboardScale(GdkEventKey const &event, int dir) length_change = 1.0 / _desktop->current_zoom() * dir; } else { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - length_change = prefs->getDoubleLimited("/options/defaultscale/value", 2, 1, 1000); + length_change = prefs->getDoubleLimited("/options/defaultscale/value", 2, 1, 1000, "px"); length_change *= dir; } double scale = (maxext + length_change) / maxext; -- cgit v1.2.3 From ee17bac8a5d9b6bf840272885c1eda57c45fb4ad Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sat, 17 Sep 2011 01:00:05 +0200 Subject: Node tool, transforming a set of nodes: Fix crashes, and finish implementation of snapping Fixed bugs: - https://launchpad.net/bugs/590261 (bzr r10633) --- src/ui/tool/control-point-selection.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/ui/tool/control-point-selection.cpp') diff --git a/src/ui/tool/control-point-selection.cpp b/src/ui/tool/control-point-selection.cpp index 13da4a712..fbcb337a5 100644 --- a/src/ui/tool/control-point-selection.cpp +++ b/src/ui/tool/control-point-selection.cpp @@ -16,6 +16,7 @@ #include "ui/tool/event-utils.h" #include "ui/tool/selectable-control-point.h" #include "ui/tool/transform-handle-set.h" +#include "ui/tool/node.h" namespace Inkscape { namespace UI { @@ -642,13 +643,24 @@ bool ControlPointSelection::event(GdkEvent *event) return false; } -std::vector ControlPointSelection::getOriginalPoints() +void ControlPointSelection::getOriginalPoints(std::vector &pts) { - std::vector points; + pts.clear(); for (iterator i = _points.begin(); i != _points.end(); ++i) { - points.push_back(Inkscape::SnapCandidatePoint(_original_positions[*i], SNAPSOURCE_NODE_HANDLE)); + pts.push_back(Inkscape::SnapCandidatePoint(_original_positions[*i], SNAPSOURCE_NODE_HANDLE)); + } +} + +void ControlPointSelection::getUnselectedPoints(std::vector &pts) +{ + pts.clear(); + ControlPointSelection::Set &nodes = this->allPoints(); + for (ControlPointSelection::Set::iterator i = nodes.begin(); i != nodes.end(); ++i) { + if (!(*i)->selected()) { + Node *n = static_cast(*i); + pts.push_back(n->snapCandidatePoint()); + } } - return points; } void ControlPointSelection::setOriginalPoints() -- cgit v1.2.3 From 6343a24c5cd0a998e00ae05fc6abe2081be21c71 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Mon, 3 Oct 2011 00:24:15 -0700 Subject: Doxygen cleanup. (bzr r10660) --- src/ui/tool/control-point-selection.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/ui/tool/control-point-selection.cpp') diff --git a/src/ui/tool/control-point-selection.cpp b/src/ui/tool/control-point-selection.cpp index fbcb337a5..1a1aee47c 100644 --- a/src/ui/tool/control-point-selection.cpp +++ b/src/ui/tool/control-point-selection.cpp @@ -1,5 +1,6 @@ -/** @file - * Node selection - implementation +/** + * @file + * Node selection - implementation. */ /* Authors: * Krzysztof KosiƄski @@ -23,7 +24,7 @@ namespace UI { /** * @class ControlPointSelection - * @brief Group of selected control points. + * Group of selected control points. * * Some operations can be performed on all selected points regardless of their type, therefore * this class is also a Manipulator. It handles the transformations of points using @@ -446,8 +447,10 @@ bool ControlPointSelection::_keyboardMove(GdkEventKey const &event, Geom::Point return true; } -/** @brief Computes the distance to the farthest corner of the bounding box. - * Used to determine what it means to "rotate by one pixel". */ +/** + * Computes the distance to the farthest corner of the bounding box. + * Used to determine what it means to "rotate by one pixel". + */ double ControlPointSelection::_rotationRadius(Geom::Point const &rc) { if (empty()) return 1.0; // some safe value @@ -460,7 +463,8 @@ double ControlPointSelection::_rotationRadius(Geom::Point const &rc) return maxlen; } -/** Rotates the selected points in the given direction according to the modifier state +/** + * Rotates the selected points in the given direction according to the modifier state * from the supplied event. * @param event Key event to take modifier state from * @param dir Direction of rotation (math convention: 1 = counterclockwise, -1 = clockwise) -- cgit v1.2.3 From 224a99dc216119d34eb3ed13d12f123158acfe3c Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Fri, 4 Nov 2011 22:30:19 +0100 Subject: 1) Cycle to the next-closest-snap-source when pressing tab, if the snap-closest-point-only-option has been activated. Works for the selector tool, but also when scaling/stretching/skewing a selection of nodes in the node tool 2) Cleanup and simplification of the code that finds the closest snapsource (bzr r10720) --- src/ui/tool/control-point-selection.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/ui/tool/control-point-selection.cpp') diff --git a/src/ui/tool/control-point-selection.cpp b/src/ui/tool/control-point-selection.cpp index 1a1aee47c..308359c33 100644 --- a/src/ui/tool/control-point-selection.cpp +++ b/src/ui/tool/control-point-selection.cpp @@ -675,7 +675,6 @@ void ControlPointSelection::setOriginalPoints() } } - } // namespace UI } // namespace Inkscape -- cgit v1.2.3