add Item::add_front()
authorPaul Davis <paul@linuxaudiosystems.com>
Sun, 25 Sep 2016 19:43:57 +0000 (14:43 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 27 Sep 2016 19:59:32 +0000 (14:59 -0500)
libs/canvas/canvas/item.h
libs/canvas/item.cc

index c7f8a0e043d5d5c8a399994b627ede4d557a37bc..2d28fcdf2af4f593b54f9b3321bfae2fe595e58e 100644 (file)
@@ -192,6 +192,7 @@ public:
 
        /* nested item ("grouping") API */
        void add (Item *);
+       void add_front (Item *);
        void remove (Item *);
         void clear (bool with_delete = false);
        std::list<Item*> const & items () const {
index dc82245ecb3ccaa4a4484933c45a331220a90ab2..711743d9f1f759240f9a15f03404f4abed1f21b6 100644 (file)
@@ -867,6 +867,17 @@ Item::add (Item* i)
        _bounding_box_dirty = true;
 }
 
+void
+Item::add_front (Item* i)
+{
+       /* XXX should really notify canvas about this */
+
+       _items.push_front (i);
+       i->reparent (this);
+       invalidate_lut ();
+       _bounding_box_dirty = true;
+}
+
 void
 Item::remove (Item* i)
 {