diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2010-02-06 21:45:14 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2010-02-06 21:45:14 +0000 |
| commit | 9d9e9264afc4e6f83d59bd25ccae505eadb739d8 (patch) | |
| tree | 3621f6c37127818a59083d5c8207f656b6bf5c7d /src/ui/tool/path-manipulator.cpp | |
| parent | Fix event handling for control points when multiple buttons are pressed; (diff) | |
| download | inkscape-9d9e9264afc4e6f83d59bd25ccae505eadb739d8.tar.gz inkscape-9d9e9264afc4e6f83d59bd25ccae505eadb739d8.zip | |
Fix performance regressions in the node tool and a stupid crash bug
when deleting more than one stretch of selected nodes
(bzr r9061)
Diffstat (limited to 'src/ui/tool/path-manipulator.cpp')
| -rw-r--r-- | src/ui/tool/path-manipulator.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index 43955edbf..b1a86dd77 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -522,7 +522,7 @@ void PathManipulator::deleteNodes(bool keep_shape) sel_end = sel_beg; while (num_selected > 0) { - while (!sel_beg->selected()) { + while (sel_beg && !sel_beg->selected()) { sel_beg = sel_beg.next(); } sel_end = sel_beg; @@ -532,6 +532,7 @@ void PathManipulator::deleteNodes(bool keep_shape) } num_selected -= _deleteStretch(sel_beg, sel_end, keep_shape); + sel_beg = sel_end; } ++i; } @@ -1294,11 +1295,12 @@ void PathManipulator::_commit(Glib::ustring const &annotation) void PathManipulator::_updateDragPoint(Geom::Point const &evp) { // TODO find a way to make this faster (no transform required) - Geom::PathVector pv = _spcurve->get_pathvector() * (_edit_transform * _i2d_transform); + Geom::Matrix to_desktop = _edit_transform * _i2d_transform; + Geom::PathVector pv = _spcurve->get_pathvector(); boost::optional<Geom::PathVectorPosition> pvp - = Geom::nearestPoint(pv, _desktop->w2d(evp)); + = Geom::nearestPoint(pv, _desktop->w2d(evp) * to_desktop.inverse()); if (!pvp) return; - Geom::Point nearest_point = _desktop->d2w(pv.at(pvp->path_nr).pointAt(pvp->t)); + Geom::Point nearest_point = _desktop->d2w(pv.at(pvp->path_nr).pointAt(pvp->t) * to_desktop); double fracpart; std::list<SubpathPtr>::iterator spi = _subpaths.begin(); |
