mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
add Rectangle::size_request() which returns actual rectangle size, not bounding box
This commit is contained in:
parent
a9c2e2f7e5
commit
35a9bcc409
3 changed files with 11 additions and 0 deletions
|
|
@ -90,6 +90,8 @@ public:
|
||||||
void set_outline_what (What);
|
void set_outline_what (What);
|
||||||
void set_outline_all () { set_outline_what (ArdourCanvas::Rectangle::ALL); }
|
void set_outline_all () { set_outline_what (ArdourCanvas::Rectangle::ALL); }
|
||||||
|
|
||||||
|
void size_request (double& w, double& h) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** Our rectangle; note that x0 may not always be less than x1
|
/** Our rectangle; note that x0 may not always be less than x1
|
||||||
* and likewise with y0 and y1.
|
* and likewise with y0 and y1.
|
||||||
|
|
|
||||||
|
|
@ -614,6 +614,8 @@ Item::size_request (double& w, double& h) const
|
||||||
{
|
{
|
||||||
Rect r (bounding_box());
|
Rect r (bounding_box());
|
||||||
|
|
||||||
|
std::cerr << "\titem " << this << " bbox " << r << std::endl;
|
||||||
|
|
||||||
w = std::max (requested_width, r.width());
|
w = std::max (requested_width, r.width());
|
||||||
h = std::max (requested_height, r.height());
|
h = std::max (requested_height, r.height());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,13 @@ Rectangle::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) con
|
||||||
render_children (area, context);
|
render_children (area, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Rectangle::size_request (double& w, double& h) const
|
||||||
|
{
|
||||||
|
w = _rect.width();
|
||||||
|
h = _rect.height();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Rectangle::compute_bounding_box () const
|
Rectangle::compute_bounding_box () const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue