13
0

This wasn't supposed to be pushed to master.

Revert "add basic data members and methods for adding an explicit size allocation for Canvas::Item"

This reverts commit d1c1d8df61.
This commit is contained in:
Paul Davis 2017-01-24 23:17:38 +01:00
parent 8432a77329
commit cce1c58198
2 changed files with 2 additions and 26 deletions

View File

@ -136,18 +136,7 @@ public:
ScrollGroup* scroll_parent() const { return _scroll_parent; }
/* item implementations can override this if they need to */
virtual Rect size_request() const { return bounding_box (true); }
void size_allocate (Rect const&);
/** bounding box is the public API to get the size of the item.
If @param for_own_purposes is false, then it will return the
allocated bounding box (if there is one) in preference to the
one that would naturally be computed by the item.
*/
Rect bounding_box (bool for_own_purposes = false) const;
Rect allocation() const { return _allocation; }
Rect bounding_box () const;
Coord height() const;
Coord width() const;
@ -292,7 +281,6 @@ protected:
mutable Rect _bounding_box;
/** true if _bounding_box might be out of date, false if its definitely not */
mutable bool _bounding_box_dirty;
Rect _allocation;
/* XXX: this is a bit grubby */
std::map<std::string, void *> _data;

View File

@ -571,15 +571,9 @@ 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 (bool for_own_purposes) const
Item::bounding_box () const
{
if (_bounding_box_dirty) {
compute_bounding_box ();
@ -587,12 +581,6 @@ Item::bounding_box (bool for_own_purposes) const
add_child_bounding_boxes ();
}
if (!for_own_purposes) {
if (_allocation) {
return _allocation;
}
}
return _bounding_box;
}