mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
Canvas: modify Arc to work with layout
This commit is contained in:
parent
ad39faeb3e
commit
f17160ee0e
2 changed files with 22 additions and 0 deletions
|
|
@ -146,3 +146,23 @@ Arc::covers (Duple const & point) const
|
|||
(angle_degs <= (_start_degrees + _arc_degrees)) &&
|
||||
(radius < _radius);
|
||||
}
|
||||
|
||||
void
|
||||
Arc::size_allocate (Rect const & r)
|
||||
{
|
||||
begin_change ();
|
||||
|
||||
Item::size_allocate (r);
|
||||
|
||||
/* This is an arc - some section of a circle, so any difference between
|
||||
* height and width cannot change what is drawn. Pick width arbitrarily
|
||||
* as the "key" dimension
|
||||
*/
|
||||
|
||||
_radius = min (r.width(),r.height()) / 2.0;
|
||||
_center = Duple ((r.width()/2.), (r.height() /2.));
|
||||
|
||||
_bounding_box_dirty = true;
|
||||
|
||||
end_change ();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue