Canvas: make Rectangle work with layouts

This commit is contained in:
Paul Davis 2020-06-10 19:37:05 -06:00
parent a9e416dea6
commit 2931cbf91f
2 changed files with 9 additions and 0 deletions

View file

@ -37,6 +37,7 @@ public:
void render (Rect const &, Cairo::RefPtr<Cairo::Context>) const;
void compute_bounding_box () const;
void size_allocate (Rect const&);
Rect const & get () const {
return _rect;

View file

@ -181,6 +181,8 @@ Rectangle::set (Rect const & r)
as cheap to do it when asked.
*/
cerr << name << " setting self rect\n";
if (r != _rect) {
begin_change ();
@ -276,3 +278,9 @@ Rectangle::vertical_fraction (double y) const
return 1.0 - ((i.y - bbox.y0) / bbox.height());
}
void
Rectangle::size_allocate (Rect const & r)
{
set (r);
}