Canvas: propagate ::size_allocate() down the item tree

This previously wasn't done because of fear that it would affect the traditional fixed-sized canvas,
but only items that _layout_sensitive (i.e. are packed into a constraint packer directly) will
actually do anything in ::size_allocate().

Possibly might want to relax this to cover items that have a constraint packer between them
and a root group.
This commit is contained in:
Paul Davis 2020-07-09 16:38:52 -06:00
parent d51893dec6
commit 860d43697c
6 changed files with 27 additions and 24 deletions

View file

@ -288,13 +288,13 @@ Rectangle::vertical_fraction (double y) const
void
Rectangle::size_allocate (Rect const & r)
{
_allocation = r;
Item::size_allocate (r);
if (_layout_sensitive) {
/* set position, and then set the _rect member with values that
use _position as the origin.
/* Item::size_allocate() will have 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);
}