add Item::redraw() convenience method
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 24 Oct 2013 21:54:54 +0000 (17:54 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 24 Oct 2013 21:54:54 +0000 (17:54 -0400)
libs/canvas/canvas/item.h
libs/canvas/item.cc

index e856c7e149c18a9a28ce013e4d47a1f634eff3d5..538ac8bb79bf115454c0059bcc9dfbbd1ac147b9 100644 (file)
@@ -56,6 +56,8 @@ public:
        Item (Group *, Duple);
        virtual ~Item ();
 
+        void redraw () const;
+
        /** Render this item to a Cairo context.
         *  @param area Area to draw, in **window** coordinates
         *
index b553d8d6ae76ff0e9e9249f0e73523fa3822d2ed..542b6e5cf58ef8ca901cf204e89827025b87da7a 100644 (file)
@@ -328,6 +328,14 @@ Item::width () const
        return 0;
 }
 
+void
+Item::redraw () const
+{
+       if (_bounding_box && _canvas) {
+               _canvas->request_redraw (item_to_canvas (_bounding_box.get()));
+       }
+}      
+
 void
 Item::begin_change ()
 {