diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2017-01-20 12:08:58 +0100 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2017-01-24 22:45:22 +0100 |
commit | d1c1d8df614672b00a9835ae04566b12d21be697 (patch) | |
tree | 7e79d4081e64bc013c18cc8f4d7ec8656eb0ecff /libs/canvas/item.cc | |
parent | f2c31a3098addc1ef2731e4db7132a821302bbc4 (diff) |
add basic data members and methods for adding an explicit size allocation for Canvas::Item
Diffstat (limited to 'libs/canvas/item.cc')
-rw-r--r-- | libs/canvas/item.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libs/canvas/item.cc b/libs/canvas/item.cc index 06ad24f2e6..589f1214b7 100644 --- a/libs/canvas/item.cc +++ b/libs/canvas/item.cc @@ -571,9 +571,15 @@ Item::grab_focus () /* XXX */ } +void +Item::size_allocate (Rect const & r) +{ + _allocation = r; +} + /** @return Bounding box in this item's coordinates */ ArdourCanvas::Rect -Item::bounding_box () const +Item::bounding_box (bool for_own_purposes) const { if (_bounding_box_dirty) { compute_bounding_box (); @@ -581,6 +587,12 @@ Item::bounding_box () const add_child_bounding_boxes (); } + if (!for_own_purposes) { + if (_allocation) { + return _allocation; + } + } + return _bounding_box; } |