13
0

Canvas: make Rectangle work with layouts

This commit is contained in:
Paul Davis 2020-06-10 19:37:05 -06:00
parent e0c58a2736
commit 240cb7b98f
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

@ -180,6 +180,8 @@ Rectangle::set (Rect const & r)
as cheap to do it when asked.
*/
cerr << name << " setting self rect\n";
if (r != _rect) {
begin_change ();
@ -275,3 +277,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);
}