From 3a650da2f5b9a0542918d28a63583d09d11db69b Mon Sep 17 00:00:00 2001 From: buliabyak Date: Fri, 12 Oct 2007 06:59:42 +0000 Subject: [PATCH] select within rect --- src/gradient-drag.cpp | 15 +++++++++++++++ src/gradient-drag.h | 1 + 2 files changed, 16 insertions(+) diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp index 9244b8fd2..2e1a8db83 100644 --- a/src/gradient-drag.cpp +++ b/src/gradient-drag.cpp @@ -1293,6 +1293,21 @@ GrDrag::selectByCoords(std::vector coords) } } + +/** +\brief Select all stops/draggers that fall within the rect +*/ +void +GrDrag::selectRect(NR::Rect const &r) +{ + for (GList *l = this->draggers; l != NULL; l = l->next) { + GrDragger *d = ((GrDragger *) l->data); + if (r.contains(d->point)) { + setSelected (d, true, true); + } + } +} + /** \brief Select a dragger \param dragger The dragger to select diff --git a/src/gradient-drag.h b/src/gradient-drag.h index b9a2fdcc2..a4cd481a3 100644 --- a/src/gradient-drag.h +++ b/src/gradient-drag.h @@ -122,6 +122,7 @@ public: // FIXME: make more of this private! void deselectAll(); void selectAll(); void selectByCoords(std::vector coords); + void selectRect(NR::Rect const &r); void deleteSelected (bool just_one = false); -- 2.30.2