summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 641ff38)
raw | patch | inline | side by side (parent: 641ff38)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Thu, 12 Apr 2007 07:22:09 +0000 (07:22 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Thu, 12 Apr 2007 07:22:09 +0000 (07:22 +0000) |
src/document.cpp | patch | blob | history | |
src/document.h | patch | blob | history |
diff --git a/src/document.cpp b/src/document.cpp
index 4dd0f3d211321cf1bb7d1c88e8278327ee57d17b..a61dffc0b4a1c3fd78d7a9045dc88c51dcc1ab86 100644 (file)
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -996,6 +996,30 @@ GSList *sp_document_partial_items_in_box(SPDocument *document, unsigned int dkey
return find_items_in_area(NULL, SP_GROUP(document->root), dkey, box, overlaps);
}
+GSList *
+sp_document_items_at_points(SPDocument *document, unsigned const key, std::vector<NR::Point> points)
+{
+ GSList *items = NULL;
+
+ // When picking along the path, we don't want small objects close together
+ // (such as hatching strokes) to obscure each other by their deltas,
+ // so we temporarily set delta to a small value
+ gdouble saved_delta = prefs_get_double_attribute ("options.cursortolerance", "value", 1.0);
+ prefs_set_double_attribute ("options.cursortolerance", "value", 0.25);
+
+ for(unsigned int i = 0; i < points.size(); i++) {
+ SPItem *item = sp_document_item_at_point(document, key, points[i],
+ false, NULL);
+ if (item && !g_slist_find(items, item))
+ items = g_slist_prepend (items, item);
+ }
+
+ // and now we restore it back
+ prefs_set_double_attribute ("options.cursortolerance", "value", saved_delta);
+
+ return items;
+}
+
SPItem *
sp_document_item_at_point(SPDocument *document, unsigned const key, NR::Point const p,
gboolean const into_groups, SPItem *upto)
diff --git a/src/document.h b/src/document.h
index 6e4bd8d6cf6599d117293e5adc53e7ff4a91eeb6..a3377f398287ad756e91387114c5aa4764f46c05 100644 (file)
--- a/src/document.h
+++ b/src/document.h
#include "gc-anchored.h"
#include <glibmm/ustring.h>
#include "verbs.h"
+#include <vector>
namespace Avoid {
class Router;
@@ -233,7 +234,8 @@ GSList * sp_document_items_in_box(SPDocument *document, unsigned int dkey, NR::R
GSList * sp_document_partial_items_in_box(SPDocument *document, unsigned int dkey, NR::Rect const &box);
SPItem* sp_document_item_from_list_at_point_bottom (unsigned int dkey, SPGroup *group, const GSList *list, NR::Point const p, bool take_insensitive = false);
SPItem * sp_document_item_at_point (SPDocument *document, unsigned int key, NR::Point const p, gboolean into_groups, SPItem *upto = NULL);
-SPItem * sp_document_group_at_point (SPDocument *document, unsigned int key, NR::Point const p);
+GSList *sp_document_items_at_points(SPDocument *document, unsigned const key, std::vector<NR::Point> points);
+SPItem *sp_document_group_at_point (SPDocument *document, unsigned int key, NR::Point const p);
void sp_document_set_uri (SPDocument *document, const gchar *uri);
void sp_document_resized_signal_emit (SPDocument *doc, gdouble width, gdouble height);