@@ -887,6 +887,63 @@ public void test_flex_grow_within_constrained_max_column() {
887887 assertEquals (50f , root_child1 .getLayoutHeight (), 0.0f );
888888 }
889889
890+ @ Test
891+ public void test_child_min_max_width_flexing () {
892+ YogaConfig config = new YogaConfig ();
893+
894+ final YogaNode root = new YogaNode (config );
895+ root .setFlexDirection (YogaFlexDirection .ROW );
896+ root .setWidth (120f );
897+ root .setHeight (50f );
898+
899+ final YogaNode root_child0 = new YogaNode (config );
900+ root_child0 .setFlexGrow (1f );
901+ root_child0 .setFlexBasis (0f );
902+ root_child0 .setMinWidth (60f );
903+ root .addChildAt (root_child0 , 0 );
904+
905+ final YogaNode root_child1 = new YogaNode (config );
906+ root_child1 .setFlexGrow (1f );
907+ root_child1 .setFlexBasisPercent (50f );
908+ root_child1 .setMaxWidth (20f );
909+ root .addChildAt (root_child1 , 1 );
910+ root .setDirection (YogaDirection .LTR );
911+ root .calculateLayout (YogaConstants .UNDEFINED , YogaConstants .UNDEFINED );
912+
913+ assertEquals (0f , root .getLayoutX (), 0.0f );
914+ assertEquals (0f , root .getLayoutY (), 0.0f );
915+ assertEquals (120f , root .getLayoutWidth (), 0.0f );
916+ assertEquals (50f , root .getLayoutHeight (), 0.0f );
917+
918+ assertEquals (0f , root_child0 .getLayoutX (), 0.0f );
919+ assertEquals (0f , root_child0 .getLayoutY (), 0.0f );
920+ assertEquals (100f , root_child0 .getLayoutWidth (), 0.0f );
921+ assertEquals (50f , root_child0 .getLayoutHeight (), 0.0f );
922+
923+ assertEquals (100f , root_child1 .getLayoutX (), 0.0f );
924+ assertEquals (0f , root_child1 .getLayoutY (), 0.0f );
925+ assertEquals (20f , root_child1 .getLayoutWidth (), 0.0f );
926+ assertEquals (50f , root_child1 .getLayoutHeight (), 0.0f );
927+
928+ root .setDirection (YogaDirection .RTL );
929+ root .calculateLayout (YogaConstants .UNDEFINED , YogaConstants .UNDEFINED );
930+
931+ assertEquals (0f , root .getLayoutX (), 0.0f );
932+ assertEquals (0f , root .getLayoutY (), 0.0f );
933+ assertEquals (120f , root .getLayoutWidth (), 0.0f );
934+ assertEquals (50f , root .getLayoutHeight (), 0.0f );
935+
936+ assertEquals (20f , root_child0 .getLayoutX (), 0.0f );
937+ assertEquals (0f , root_child0 .getLayoutY (), 0.0f );
938+ assertEquals (100f , root_child0 .getLayoutWidth (), 0.0f );
939+ assertEquals (50f , root_child0 .getLayoutHeight (), 0.0f );
940+
941+ assertEquals (0f , root_child1 .getLayoutX (), 0.0f );
942+ assertEquals (0f , root_child1 .getLayoutY (), 0.0f );
943+ assertEquals (20f , root_child1 .getLayoutWidth (), 0.0f );
944+ assertEquals (50f , root_child1 .getLayoutHeight (), 0.0f );
945+ }
946+
890947 @ Test
891948 public void test_min_width_overrides_width () {
892949 YogaConfig config = new YogaConfig ();
0 commit comments