diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-11-03 15:56:23 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-11-05 23:14:17 +0000 |
| commit | d9e1fb5db48f46e52dbb171e7bdcee1602d8eb14 (patch) | |
| tree | e84adb8bf6f13e389aade356fa4e6c0abdd62dc3 /src/desktop.cpp | |
| parent | remove Inkscape::URI::toString (diff) | |
| download | inkscape-d9e1fb5db48f46e52dbb171e7bdcee1602d8eb14.tar.gz inkscape-d9e1fb5db48f46e52dbb171e7bdcee1602d8eb14.zip | |
Improvemets to find items
Diffstat (limited to 'src/desktop.cpp')
| -rw-r--r-- | src/desktop.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp index 335afa17d..7846599c7 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -726,6 +726,19 @@ SPItem *SPDesktop::getGroupAtPoint(Geom::Point const &p) const g_return_val_if_fail (doc() != nullptr, NULL); return doc()->getGroupAtPoint(dkey, p); } +/** + * Returns a vector of visible items in a desktop + */ +std::vector<SPItem *> SPDesktop::getVisibleItems(bool isFiltered) { + std::vector<SPItem *> result; + for(auto item:getDocument()->getItemsPartiallyInBox(dkey, get_display_area(), false, true, true, false, true)) { + if(isFiltered && !item->isFiltered()) { + continue; + } + result.push_back(item); + } + return result; +} /** * Returns the mouse point in document coordinates; if mouse is |
