diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2016-02-16 01:42:58 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2016-02-16 01:42:58 +0000 |
| commit | f200503cc154d84f3e4aa87400c1c045bfa80937 (patch) | |
| tree | 4343eb7400eccaf940e3f2aeb9416043e03e377c /src/document.h | |
| parent | Translations. Icelandic translation update. (diff) | |
| download | inkscape-f200503cc154d84f3e4aa87400c1c045bfa80937.tar.gz inkscape-f200503cc154d84f3e4aa87400c1c045bfa80937.zip | |
Performance improvements when working in large files
At each mouse move, a list of all elements in the document was computed (to get the correct cursor, in text mode for instance). This list is now cached.
(bzr r14655)
Diffstat (limited to 'src/document.h')
| -rw-r--r-- | src/document.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/document.h b/src/document.h index b4a8a8e8e..b57cf205d 100644 --- a/src/document.h +++ b/src/document.h @@ -28,6 +28,7 @@ #include <boost/ptr_container/ptr_list.hpp> #include <vector> #include <set> +#include <deque> namespace Avoid { class Router; @@ -262,8 +263,8 @@ public: const std::set<SPObject *> getResourceList(char const *key) const; std::vector<SPItem*> getItemsInBox(unsigned int dkey, Geom::Rect const &box, bool into_groups = false) const; std::vector<SPItem*> getItemsPartiallyInBox(unsigned int dkey, Geom::Rect const &box, bool into_groups = false) const; - SPItem *getItemAtPoint(unsigned int key, Geom::Point const &p, bool into_groups, SPItem *upto = NULL) const; - std::vector<SPItem*> getItemsAtPoints(unsigned const key, std::vector<Geom::Point> points, bool all_layers = true, size_t limit = 0) const; + SPItem *getItemAtPoint(unsigned int key, Geom::Point const &p, bool into_groups, SPItem *upto = NULL) ; + std::vector<SPItem*> getItemsAtPoints(unsigned const key, std::vector<Geom::Point> points, bool all_layers = true, size_t limit = 0) ; SPItem *getGroupAtPoint(unsigned int key, Geom::Point const &p) const; void changeUriAndHrefs(char const *uri); @@ -277,6 +278,9 @@ private: void do_change_uri(char const *const filename, bool const rebase); void setupViewport(SPItemCtx *ctx); void importDefsNode(SPDocument *source, Inkscape::XML::Node *defs, Inkscape::XML::Node *target_defs); + bool build_flat_item_list(unsigned int dkey, SPGroup *group, gboolean into_groups, bool take_insensitive = false, SPItem *upto = NULL); + std::deque<SPItem*> _node_cache; + bool _node_cache_valid; }; /* |
