@@ -1771,4 +1771,59 @@ public void test_align_content_stretch_column() {
17711771 assertEquals (50f , root_child4 .getLayoutHeight (), 0.0f );
17721772 }
17731773
1774+ @ Test
1775+ public void test_align_content_stretch_is_not_overriding_align_items () {
1776+ final YogaNode root = new YogaNode ();
1777+ root .setAlignContent (YogaAlign .STRETCH );
1778+
1779+ final YogaNode root_child0 = new YogaNode ();
1780+ root_child0 .setFlexDirection (YogaFlexDirection .ROW );
1781+ root_child0 .setAlignContent (YogaAlign .STRETCH );
1782+ root_child0 .setAlignItems (YogaAlign .CENTER );
1783+ root_child0 .setWidth (100f );
1784+ root_child0 .setHeight (100f );
1785+ root .addChildAt (root_child0 , 0 );
1786+
1787+ final YogaNode root_child0_child0 = new YogaNode ();
1788+ root_child0_child0 .setAlignContent (YogaAlign .STRETCH );
1789+ root_child0_child0 .setWidth (10f );
1790+ root_child0_child0 .setHeight (10f );
1791+ root_child0 .addChildAt (root_child0_child0 , 0 );
1792+ root .setDirection (YogaDirection .LTR );
1793+ root .calculateLayout (YogaConstants .UNDEFINED , YogaConstants .UNDEFINED );
1794+
1795+ assertEquals (0f , root .getLayoutX (), 0.0f );
1796+ assertEquals (0f , root .getLayoutY (), 0.0f );
1797+ assertEquals (100f , root .getLayoutWidth (), 0.0f );
1798+ assertEquals (100f , root .getLayoutHeight (), 0.0f );
1799+
1800+ assertEquals (0f , root_child0 .getLayoutX (), 0.0f );
1801+ assertEquals (0f , root_child0 .getLayoutY (), 0.0f );
1802+ assertEquals (100f , root_child0 .getLayoutWidth (), 0.0f );
1803+ assertEquals (100f , root_child0 .getLayoutHeight (), 0.0f );
1804+
1805+ assertEquals (0f , root_child0_child0 .getLayoutX (), 0.0f );
1806+ assertEquals (45f , root_child0_child0 .getLayoutY (), 0.0f );
1807+ assertEquals (10f , root_child0_child0 .getLayoutWidth (), 0.0f );
1808+ assertEquals (10f , root_child0_child0 .getLayoutHeight (), 0.0f );
1809+
1810+ root .setDirection (YogaDirection .RTL );
1811+ root .calculateLayout (YogaConstants .UNDEFINED , YogaConstants .UNDEFINED );
1812+
1813+ assertEquals (0f , root .getLayoutX (), 0.0f );
1814+ assertEquals (0f , root .getLayoutY (), 0.0f );
1815+ assertEquals (100f , root .getLayoutWidth (), 0.0f );
1816+ assertEquals (100f , root .getLayoutHeight (), 0.0f );
1817+
1818+ assertEquals (0f , root_child0 .getLayoutX (), 0.0f );
1819+ assertEquals (0f , root_child0 .getLayoutY (), 0.0f );
1820+ assertEquals (100f , root_child0 .getLayoutWidth (), 0.0f );
1821+ assertEquals (100f , root_child0 .getLayoutHeight (), 0.0f );
1822+
1823+ assertEquals (90f , root_child0_child0 .getLayoutX (), 0.0f );
1824+ assertEquals (45f , root_child0_child0 .getLayoutY (), 0.0f );
1825+ assertEquals (10f , root_child0_child0 .getLayoutWidth (), 0.0f );
1826+ assertEquals (10f , root_child0_child0 .getLayoutHeight (), 0.0f );
1827+ }
1828+
17741829}
0 commit comments