summaryrefslogtreecommitdiffstats
path: root/src/ui/tool/multi-path-manipulator.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-01-10 00:46:28 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-01-10 00:46:28 +0000
commitb52865a71a9f83da9719a3ec5f50a4a2cd7cdace (patch)
tree6d8def69ad0aa28aa4414dc9d501707444a5419b /src/ui/tool/multi-path-manipulator.cpp
parentImplement selection linear grow (diff)
downloadinkscape-b52865a71a9f83da9719a3ec5f50a4a2cd7cdace.tar.gz
inkscape-b52865a71a9f83da9719a3ec5f50a4a2cd7cdace.zip
* Implement node snapping.
* Fix minor bug in linear grow. * Add --fixes. * Move some node selection-related functions to ControlPointSelection. Fixed bugs: - https://launchpad.net/bugs/170561 - https://launchpad.net/bugs/171893 - https://launchpad.net/bugs/182585 - https://launchpad.net/bugs/446773 (bzr r8846.2.9)
Diffstat (limited to 'src/ui/tool/multi-path-manipulator.cpp')
-rw-r--r--src/ui/tool/multi-path-manipulator.cpp52
1 files changed, 1 insertions, 51 deletions
diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp
index ac0165e1a..33d96c706 100644
--- a/src/ui/tool/multi-path-manipulator.cpp
+++ b/src/ui/tool/multi-path-manipulator.cpp
@@ -181,71 +181,21 @@ void MultiPathManipulator::setItems(std::set<ShapeRecord> const &s)
void MultiPathManipulator::selectSubpaths()
{
if (_selection.empty()) {
- invokeForAll(&PathManipulator::selectAll);
+ _selection.selectAll();
} else {
invokeForAll(&PathManipulator::selectSubpaths);
}
}
-void MultiPathManipulator::selectAll()
-{
- invokeForAll(&PathManipulator::selectAll);
-}
-
-void MultiPathManipulator::selectArea(Geom::Rect const &area, bool take)
-{
- if (take) _selection.clear();
- invokeForAll(&PathManipulator::selectArea, area);
-}
void MultiPathManipulator::shiftSelection(int dir)
{
invokeForAll(&PathManipulator::shiftSelection, dir);
}
-void MultiPathManipulator::spatialGrow(NodeList::iterator origin, int dir)
-{
- double extr_dist = dir > 0 ? HUGE_VAL : -HUGE_VAL;
- NodeList::iterator target;
- do { // this substitutes for goto
- if ((dir > 0 && !origin->selected())) {
- target = origin;
- break;
- }
-
- bool closest = dir > 0; // when growing, find closest node
- bool selected = dir < 0; // when growing, consider only unselected nodes
-
- for (MapType::iterator i = _mmap.begin(); i != _mmap.end(); ++i) {
- NodeList::iterator t = i->second->extremeNode(origin, selected, !selected, closest);
- if (!t) continue;
- double dist = Geom::distance(*t, *origin);
- bool cond = closest ? (dist < extr_dist) : (dist > extr_dist);
- if (cond) {
- extr_dist = dist;
- target = t;
- }
- }
- } while (0);
-
- if (!target) return;
- if (dir > 0) {
- _selection.insert(target.ptr());
- } else {
- _selection.erase(target.ptr());
- }
-}
-void MultiPathManipulator::invertSelection()
-{
- invokeForAll(&PathManipulator::invertSelection);
-}
void MultiPathManipulator::invertSelectionInSubpaths()
{
invokeForAll(&PathManipulator::invertSelectionInSubpaths);
}
-void MultiPathManipulator::deselect()
-{
- _selection.clear();
-}
void MultiPathManipulator::setNodeType(NodeType type)
{