diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-10-24 17:54:54 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-10-24 17:54:54 -0400 |
commit | ecd29c6d709e9cd7344be582650c437ae7c8cb25 (patch) | |
tree | 05e27fd632ceb9b158b4c4c690ac9fd5fa2b7f7e | |
parent | c3f1369cfdeb4b6bafcb5e25defeb66de4121251 (diff) |
add Item::redraw() convenience method
-rw-r--r-- | libs/canvas/canvas/item.h | 2 | ||||
-rw-r--r-- | libs/canvas/item.cc | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/libs/canvas/canvas/item.h b/libs/canvas/canvas/item.h index e856c7e149..538ac8bb79 100644 --- a/libs/canvas/canvas/item.h +++ b/libs/canvas/canvas/item.h @@ -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 * diff --git a/libs/canvas/item.cc b/libs/canvas/item.cc index b553d8d6ae..542b6e5cf5 100644 --- a/libs/canvas/item.cc +++ b/libs/canvas/item.cc @@ -329,6 +329,14 @@ Item::width () const } void +Item::redraw () const +{ + if (_bounding_box && _canvas) { + _canvas->request_redraw (item_to_canvas (_bounding_box.get())); + } +} + +void Item::begin_change () { _pre_change_bounding_box = bounding_box (); |