From 9d9e9264afc4e6f83d59bd25ccae505eadb739d8 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 6 Feb 2010 22:45:14 +0100 Subject: Fix performance regressions in the node tool and a stupid crash bug when deleting more than one stretch of selected nodes (bzr r9061) --- src/ui/tool/path-manipulator.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/ui/tool/path-manipulator.cpp') 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 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::iterator spi = _subpaths.begin(); -- cgit v1.2.3