Skip to content

Commit

Permalink
Layout misc fixes
Browse files Browse the repository at this point in the history
Fixes a couple of issues:
1. When checking if a component should default to fixed or hug, parametric Shapes were improperly bucketed as fixed because a Shape is a Node, so the if statement needed to be adjusted.
2. When synching style, need to reset flexGrow/flexShrink in particular because if a layout was created with type fill initially, the flexShrink value would never get reset, so the sizing behavior was wrong.

Diffs=
bc4d42b7b Layout misc fixes (#8292)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
philter and philter committed Oct 7, 2024
1 parent c1c4868 commit 7d2dbd3
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
31bf5a44f282bd4c233a6fb9e44e73b0378bf449
bc4d42b7b3d24c4ba12d3f2af32904c910d37d70
3 changes: 3 additions & 0 deletions src/layout_component.cpp
Original file line number Diff line number Diff line change
@@ -356,6 +356,9 @@ void LayoutComponent::syncStyle()
ygStyle.dimensions()[YGDimensionWidth] = YGValue{realWidth, realWidthUnits};
ygStyle.dimensions()[YGDimensionHeight] = YGValue{realHeight, realHeightUnits};

ygStyle.flexGrow() = YGFloatOptional();
ygStyle.flexShrink() = YGFloatOptional();
ygStyle.alignSelf() = YGAlignAuto;
switch (realWidthScaleType)
{
case LayoutScaleType::fixed:

0 comments on commit 7d2dbd3

Please sign in to comment.