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)) &&
|
(angle_degs <= (_start_degrees + _arc_degrees)) &&
|
||||||
(radius < _radius);
|
(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 ();
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ public:
|
||||||
void render (Rect const & area, Cairo::RefPtr<Cairo::Context>) const;
|
void render (Rect const & area, Cairo::RefPtr<Cairo::Context>) const;
|
||||||
void compute_bounding_box () const;
|
void compute_bounding_box () const;
|
||||||
|
|
||||||
|
void size_allocate (Rect const & r);
|
||||||
|
|
||||||
void set_center (Duple const &);
|
void set_center (Duple const &);
|
||||||
void set_radius (Coord);
|
void set_radius (Coord);
|
||||||
void set_arc (double degrees);
|
void set_arc (double degrees);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue