Code

select within rect
authorbuliabyak <buliabyak@users.sourceforge.net>
Fri, 12 Oct 2007 06:59:42 +0000 (06:59 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Fri, 12 Oct 2007 06:59:42 +0000 (06:59 +0000)
src/gradient-drag.cpp
src/gradient-drag.h

index 9244b8fd2aaccf264ea13f84e282ed5d10d0a8ac..2e1a8db8393ba5dc1b2845c27a799b7424ebb418 100644 (file)
@@ -1293,6 +1293,21 @@ GrDrag::selectByCoords(std::vector<NR::Point> 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
index b9a2fdcc22aa66204818e697958b588079427589..a4cd481a3be9282cebf7f165e53da791fe47f5d8 100644 (file)
@@ -122,6 +122,7 @@ public: // FIXME: make more of this private!
     void deselectAll();
                void selectAll();
                void selectByCoords(std::vector<NR::Point> coords);
+    void selectRect(NR::Rect const &r);
     
     void deleteSelected (bool just_one = false);