From 3f4989722b26a62535e05f01400f044e86689141 Mon Sep 17 00:00:00 2001 From: Thomas Holder Date: Fri, 18 Oct 2019 19:46:49 +0200 Subject: fix #476 ignore hidden layers when selecting --- src/document.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index 4ce3fe495..ccea1f583 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -1319,6 +1319,14 @@ static std::vector &find_items_in_area(std::vector &s, for (auto& o: group->children) { if (SPItem *item = dynamic_cast(&o)) { + if (!take_insensitive && item->isLocked()) { + continue; + } + + if (!take_hidden && item->isHidden()) { + continue; + } + if (SPGroup * childgroup = dynamic_cast(item)) { bool is_layer = childgroup->effectiveLayerMode(dkey) == SPGroup::LAYER; if (is_layer || (enter_groups)) { @@ -1329,10 +1337,7 @@ static std::vector &find_items_in_area(std::vector &s, } } Geom::OptRect box = item->documentVisualBounds(); - if (box && test(area, *box) - && (take_insensitive || !item->isLocked()) - && (take_hidden || !item->isHidden())) - { + if (box && test(area, *box)) { s.push_back(item); } } -- cgit v1.2.3