Fix handling empty children in ui::box_layout
This commit is contained in:
parent
6089c02e90
commit
820a184fa7
1 changed files with 7 additions and 6 deletions
|
|
@ -125,12 +125,13 @@ namespace psemek::ui::impl
|
||||||
float pen = new_shape[Dimension].min;
|
float pen = new_shape[Dimension].min;
|
||||||
for (std::size_t i = 0; i < children().size(); ++i)
|
for (std::size_t i = 0; i < children().size(); ++i)
|
||||||
{
|
{
|
||||||
if (!children()[i]) continue;
|
if (children()[i])
|
||||||
|
{
|
||||||
geom::box<float, 2> child_shape;
|
geom::box<float, 2> child_shape;
|
||||||
child_shape[Dimension] = {pen, pen + sizes[i]};
|
child_shape[Dimension] = {pen, pen + sizes[i]};
|
||||||
child_shape[Dimension ^ 1] = new_shape[Dimension ^ 1];
|
child_shape[Dimension ^ 1] = new_shape[Dimension ^ 1];
|
||||||
children()[i]->reshape(child_shape);
|
children()[i]->reshape(child_shape);
|
||||||
|
}
|
||||||
|
|
||||||
pen += sizes[i];
|
pen += sizes[i];
|
||||||
pen += padding;
|
pen += padding;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue