summaryrefslogtreecommitdiffstats
path: root/src/display
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2018-03-10 14:09:42 +0000
committerEduard Braun <eduard.braun2@gmx.de>2018-03-12 18:27:53 +0000
commit8052d8eadcfa0201ee0ec7a1230bbf91c470da79 (patch)
tree111aa07f56a825b425a4cd646d63f48df5a75c8b /src/display
parentFixed more trivial typos (diff)
downloadinkscape-8052d8eadcfa0201ee0ec7a1230bbf91c470da79.tar.gz
inkscape-8052d8eadcfa0201ee0ec7a1230bbf91c470da79.zip
Speed up removing items from SPCanvasGroup
This shortcut is possible as there are no duplicate items in SPCanvasGroup. It reverts to the behavior before ab7cc89c4f9f938575e777530c31312cde116208 which introduced a severe performance regression when deselecting paths with many nodes while the node tool is active. Fixed bugs: - https://bugs.launchpad.net/inkscape/+bug/1652100 - https://bugs.launchpad.net/inkscape/+bug/1745763
Diffstat (limited to 'src/display')
-rw-r--r--src/display/sp-canvas.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp
index 20ad27bf5..c717bc7ae 100644
--- a/src/display/sp-canvas.cpp
+++ b/src/display/sp-canvas.cpp
@@ -905,9 +905,12 @@ void SPCanvasGroup::add(SPCanvasItem *item)
void SPCanvasGroup::remove(SPCanvasItem *item)
{
-
g_return_if_fail(item != NULL);
- items.remove(item);
+
+ auto position = std::find(items.begin(), items.end(), item);
+ if (position != items.end()) {
+ items.erase(position);
+ }
// Unparent the child
item->parent = NULL;