Canvas: fix behavior of Rectangle when used in a constraint packer

::size_allocate() sets the _position *and* the "self" rect appropriately
This commit is contained in:
Paul Davis 2020-07-08 21:49:31 -06:00
parent 3c2bd05750
commit 28f85747ca

View file

@ -288,12 +288,15 @@ Rectangle::vertical_fraction (double y) const
void
Rectangle::size_allocate (Rect const & r)
{
/* leave position alone */
_allocation = r;
if (_layout_sensitive) {
set (r);
/* set position, and then set the _rect member with values that
use _position as the origin.
*/
_position = Duple (r.x0, r.y0);
Rect r2 (0, 0, r.x1 - r.x0, r.y1 - r.y0);
set (r2);
}
}
@ -306,3 +309,4 @@ Rectangle::set_corner_radius (double r)
_corner_radius = r;
end_change ();
}