@@ -4517,6 +4517,247 @@ public void test_static_position_justify_center_amalgamation() {
4517
4517
assertEquals (50f , root_child0_child0_child2_child0 .getLayoutHeight (), 0.0f );
4518
4518
}
4519
4519
4520
+ @ Test
4521
+ public void test_static_position_justify_flex_end_amalgamation () {
4522
+ YogaConfig config = YogaConfigFactory .create ();
4523
+ config .setExperimentalFeatureEnabled (YogaExperimentalFeature .ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE , true );
4524
+
4525
+ final YogaNode root = createNode (config );
4526
+ root .setPositionType (YogaPositionType .ABSOLUTE );
4527
+
4528
+ final YogaNode root_child0 = createNode (config );
4529
+ root_child0 .setPositionType (YogaPositionType .RELATIVE );
4530
+ root_child0 .setMargin (YogaEdge .LEFT , 4f );
4531
+ root_child0 .setMargin (YogaEdge .TOP , 5f );
4532
+ root_child0 .setMargin (YogaEdge .RIGHT , 9f );
4533
+ root_child0 .setMargin (YogaEdge .BOTTOM , 1f );
4534
+ root_child0 .setPadding (YogaEdge .LEFT , 2 );
4535
+ root_child0 .setPadding (YogaEdge .TOP , 9 );
4536
+ root_child0 .setPadding (YogaEdge .RIGHT , 11 );
4537
+ root_child0 .setPadding (YogaEdge .BOTTOM , 13 );
4538
+ root_child0 .setBorder (YogaEdge .LEFT , 5f );
4539
+ root_child0 .setBorder (YogaEdge .TOP , 6f );
4540
+ root_child0 .setBorder (YogaEdge .RIGHT , 7f );
4541
+ root_child0 .setBorder (YogaEdge .BOTTOM , 8f );
4542
+ root .addChildAt (root_child0 , 0 );
4543
+
4544
+ final YogaNode root_child0_child0 = createNode (config );
4545
+ root_child0_child0 .setJustifyContent (YogaJustify .FLEX_END );
4546
+ root_child0_child0 .setMargin (YogaEdge .LEFT , 8f );
4547
+ root_child0_child0 .setMargin (YogaEdge .TOP , 6f );
4548
+ root_child0_child0 .setMargin (YogaEdge .RIGHT , 3f );
4549
+ root_child0_child0 .setMargin (YogaEdge .BOTTOM , 9f );
4550
+ root_child0_child0 .setPadding (YogaEdge .LEFT , 1 );
4551
+ root_child0_child0 .setPadding (YogaEdge .TOP , 7 );
4552
+ root_child0_child0 .setPadding (YogaEdge .RIGHT , 9 );
4553
+ root_child0_child0 .setPadding (YogaEdge .BOTTOM , 4 );
4554
+ root_child0_child0 .setBorder (YogaEdge .LEFT , 8f );
4555
+ root_child0_child0 .setBorder (YogaEdge .TOP , 10f );
4556
+ root_child0_child0 .setBorder (YogaEdge .RIGHT , 2f );
4557
+ root_child0_child0 .setBorder (YogaEdge .BOTTOM , 1f );
4558
+ root_child0 .addChildAt (root_child0_child0 , 0 );
4559
+
4560
+ final YogaNode root_child0_child0_child0 = createNode (config );
4561
+ root_child0_child0_child0 .setPositionType (YogaPositionType .ABSOLUTE );
4562
+ root_child0_child0_child0 .setMargin (YogaEdge .LEFT , 9f );
4563
+ root_child0_child0_child0 .setMargin (YogaEdge .TOP , 12f );
4564
+ root_child0_child0_child0 .setMargin (YogaEdge .RIGHT , 4f );
4565
+ root_child0_child0_child0 .setMargin (YogaEdge .BOTTOM , 7f );
4566
+ root_child0_child0_child0 .setPadding (YogaEdge .LEFT , 5 );
4567
+ root_child0_child0_child0 .setPadding (YogaEdge .TOP , 3 );
4568
+ root_child0_child0_child0 .setPadding (YogaEdge .RIGHT , 8 );
4569
+ root_child0_child0_child0 .setPadding (YogaEdge .BOTTOM , 10 );
4570
+ root_child0_child0_child0 .setBorder (YogaEdge .LEFT , 2f );
4571
+ root_child0_child0_child0 .setBorder (YogaEdge .TOP , 1f );
4572
+ root_child0_child0_child0 .setBorder (YogaEdge .RIGHT , 5f );
4573
+ root_child0_child0_child0 .setBorder (YogaEdge .BOTTOM , 9f );
4574
+ root_child0_child0_child0 .setWidthPercent (21f );
4575
+ root_child0_child0 .addChildAt (root_child0_child0_child0 , 0 );
4576
+
4577
+ final YogaNode root_child0_child0_child0_child0 = createNode (config );
4578
+ root_child0_child0_child0_child0 .setPositionType (YogaPositionType .RELATIVE );
4579
+ root_child0_child0_child0_child0 .setMargin (YogaEdge .LEFT , 9f );
4580
+ root_child0_child0_child0_child0 .setMargin (YogaEdge .TOP , 12f );
4581
+ root_child0_child0_child0_child0 .setMargin (YogaEdge .RIGHT , 4f );
4582
+ root_child0_child0_child0_child0 .setMargin (YogaEdge .BOTTOM , 7f );
4583
+ root_child0_child0_child0_child0 .setPadding (YogaEdge .LEFT , 5 );
4584
+ root_child0_child0_child0_child0 .setPadding (YogaEdge .TOP , 3 );
4585
+ root_child0_child0_child0_child0 .setPadding (YogaEdge .RIGHT , 8 );
4586
+ root_child0_child0_child0_child0 .setPadding (YogaEdge .BOTTOM , 10 );
4587
+ root_child0_child0_child0_child0 .setBorder (YogaEdge .LEFT , 2f );
4588
+ root_child0_child0_child0_child0 .setBorder (YogaEdge .TOP , 1f );
4589
+ root_child0_child0_child0_child0 .setBorder (YogaEdge .RIGHT , 5f );
4590
+ root_child0_child0_child0_child0 .setBorder (YogaEdge .BOTTOM , 9f );
4591
+ root_child0_child0_child0_child0 .setWidth (100f );
4592
+ root_child0_child0_child0_child0 .setHeight (50f );
4593
+ root_child0_child0_child0 .addChildAt (root_child0_child0_child0_child0 , 0 );
4594
+
4595
+ final YogaNode root_child0_child0_child1 = createNode (config );
4596
+ root_child0_child0_child1 .setPositionType (YogaPositionType .RELATIVE );
4597
+ root_child0_child0_child1 .setMargin (YogaEdge .LEFT , 9f );
4598
+ root_child0_child0_child1 .setMargin (YogaEdge .TOP , 12f );
4599
+ root_child0_child0_child1 .setMargin (YogaEdge .RIGHT , 4f );
4600
+ root_child0_child0_child1 .setMargin (YogaEdge .BOTTOM , 7f );
4601
+ root_child0_child0_child1 .setPadding (YogaEdge .LEFT , 5 );
4602
+ root_child0_child0_child1 .setPadding (YogaEdge .TOP , 3 );
4603
+ root_child0_child0_child1 .setPadding (YogaEdge .RIGHT , 8 );
4604
+ root_child0_child0_child1 .setPadding (YogaEdge .BOTTOM , 10 );
4605
+ root_child0_child0_child1 .setBorder (YogaEdge .LEFT , 2f );
4606
+ root_child0_child0_child1 .setBorder (YogaEdge .TOP , 1f );
4607
+ root_child0_child0_child1 .setBorder (YogaEdge .RIGHT , 5f );
4608
+ root_child0_child0_child1 .setBorder (YogaEdge .BOTTOM , 9f );
4609
+ root_child0_child0_child1 .setWidthPercent (10f );
4610
+ root_child0_child0 .addChildAt (root_child0_child0_child1 , 1 );
4611
+
4612
+ final YogaNode root_child0_child0_child1_child0 = createNode (config );
4613
+ root_child0_child0_child1_child0 .setPositionType (YogaPositionType .RELATIVE );
4614
+ root_child0_child0_child1_child0 .setMargin (YogaEdge .LEFT , 9f );
4615
+ root_child0_child0_child1_child0 .setMargin (YogaEdge .TOP , 12f );
4616
+ root_child0_child0_child1_child0 .setMargin (YogaEdge .RIGHT , 4f );
4617
+ root_child0_child0_child1_child0 .setMargin (YogaEdge .BOTTOM , 7f );
4618
+ root_child0_child0_child1_child0 .setPadding (YogaEdge .LEFT , 5 );
4619
+ root_child0_child0_child1_child0 .setPadding (YogaEdge .TOP , 3 );
4620
+ root_child0_child0_child1_child0 .setPadding (YogaEdge .RIGHT , 8 );
4621
+ root_child0_child0_child1_child0 .setPadding (YogaEdge .BOTTOM , 10 );
4622
+ root_child0_child0_child1_child0 .setBorder (YogaEdge .LEFT , 2f );
4623
+ root_child0_child0_child1_child0 .setBorder (YogaEdge .TOP , 1f );
4624
+ root_child0_child0_child1_child0 .setBorder (YogaEdge .RIGHT , 5f );
4625
+ root_child0_child0_child1_child0 .setBorder (YogaEdge .BOTTOM , 9f );
4626
+ root_child0_child0_child1_child0 .setWidth (100f );
4627
+ root_child0_child0_child1_child0 .setHeight (50f );
4628
+ root_child0_child0_child1 .addChildAt (root_child0_child0_child1_child0 , 0 );
4629
+
4630
+ final YogaNode root_child0_child0_child2 = createNode (config );
4631
+ root_child0_child0_child2 .setPositionType (YogaPositionType .RELATIVE );
4632
+ root_child0_child0_child2 .setMargin (YogaEdge .LEFT , 9f );
4633
+ root_child0_child0_child2 .setMargin (YogaEdge .TOP , 12f );
4634
+ root_child0_child0_child2 .setMargin (YogaEdge .RIGHT , 4f );
4635
+ root_child0_child0_child2 .setMargin (YogaEdge .BOTTOM , 7f );
4636
+ root_child0_child0_child2 .setPadding (YogaEdge .LEFT , 5 );
4637
+ root_child0_child0_child2 .setPadding (YogaEdge .TOP , 3 );
4638
+ root_child0_child0_child2 .setPadding (YogaEdge .RIGHT , 8 );
4639
+ root_child0_child0_child2 .setPadding (YogaEdge .BOTTOM , 10 );
4640
+ root_child0_child0_child2 .setBorder (YogaEdge .LEFT , 2f );
4641
+ root_child0_child0_child2 .setBorder (YogaEdge .TOP , 1f );
4642
+ root_child0_child0_child2 .setBorder (YogaEdge .RIGHT , 5f );
4643
+ root_child0_child0_child2 .setBorder (YogaEdge .BOTTOM , 9f );
4644
+ root_child0_child0_child2 .setWidthPercent (10f );
4645
+ root_child0_child0 .addChildAt (root_child0_child0_child2 , 2 );
4646
+
4647
+ final YogaNode root_child0_child0_child2_child0 = createNode (config );
4648
+ root_child0_child0_child2_child0 .setPositionType (YogaPositionType .RELATIVE );
4649
+ root_child0_child0_child2_child0 .setMargin (YogaEdge .LEFT , 9f );
4650
+ root_child0_child0_child2_child0 .setMargin (YogaEdge .TOP , 12f );
4651
+ root_child0_child0_child2_child0 .setMargin (YogaEdge .RIGHT , 4f );
4652
+ root_child0_child0_child2_child0 .setMargin (YogaEdge .BOTTOM , 7f );
4653
+ root_child0_child0_child2_child0 .setPadding (YogaEdge .LEFT , 5 );
4654
+ root_child0_child0_child2_child0 .setPadding (YogaEdge .TOP , 3 );
4655
+ root_child0_child0_child2_child0 .setPadding (YogaEdge .RIGHT , 8 );
4656
+ root_child0_child0_child2_child0 .setPadding (YogaEdge .BOTTOM , 10 );
4657
+ root_child0_child0_child2_child0 .setBorder (YogaEdge .LEFT , 2f );
4658
+ root_child0_child0_child2_child0 .setBorder (YogaEdge .TOP , 1f );
4659
+ root_child0_child0_child2_child0 .setBorder (YogaEdge .RIGHT , 5f );
4660
+ root_child0_child0_child2_child0 .setBorder (YogaEdge .BOTTOM , 9f );
4661
+ root_child0_child0_child2_child0 .setWidth (100f );
4662
+ root_child0_child0_child2_child0 .setHeight (50f );
4663
+ root_child0_child0_child2 .addChildAt (root_child0_child0_child2_child0 , 0 );
4664
+ root .setDirection (YogaDirection .LTR );
4665
+ root .calculateLayout (YogaConstants .UNDEFINED , YogaConstants .UNDEFINED );
4666
+
4667
+ assertEquals (0f , root .getLayoutX (), 0.0f );
4668
+ assertEquals (0f , root .getLayoutY (), 0.0f );
4669
+ assertEquals (215f , root .getLayoutWidth (), 0.0f );
4670
+ assertEquals (301f , root .getLayoutHeight (), 0.0f );
4671
+
4672
+ assertEquals (4f , root_child0 .getLayoutX (), 0.0f );
4673
+ assertEquals (5f , root_child0 .getLayoutY (), 0.0f );
4674
+ assertEquals (202f , root_child0 .getLayoutWidth (), 0.0f );
4675
+ assertEquals (295f , root_child0 .getLayoutHeight (), 0.0f );
4676
+
4677
+ assertEquals (15f , root_child0_child0 .getLayoutX (), 0.0f );
4678
+ assertEquals (21f , root_child0_child0 .getLayoutY (), 0.0f );
4679
+ assertEquals (166f , root_child0_child0 .getLayoutWidth (), 0.0f );
4680
+ assertEquals (244f , root_child0_child0 .getLayoutHeight (), 0.0f );
4681
+
4682
+ assertEquals (18f , root_child0_child0_child0 .getLayoutX (), 0.0f );
4683
+ assertEquals (140f , root_child0_child0_child0 .getLayoutY (), 0.0f );
4684
+ assertEquals (40f , root_child0_child0_child0 .getLayoutWidth (), 0.0f );
4685
+ assertEquals (92f , root_child0_child0_child0 .getLayoutHeight (), 0.0f );
4686
+
4687
+ assertEquals (16f , root_child0_child0_child0_child0 .getLayoutX (), 0.0f );
4688
+ assertEquals (16f , root_child0_child0_child0_child0 .getLayoutY (), 0.0f );
4689
+ assertEquals (100f , root_child0_child0_child0_child0 .getLayoutWidth (), 0.0f );
4690
+ assertEquals (50f , root_child0_child0_child0_child0 .getLayoutHeight (), 0.0f );
4691
+
4692
+ assertEquals (18f , root_child0_child0_child1 .getLayoutX (), 0.0f );
4693
+ assertEquals (29f , root_child0_child0_child1 .getLayoutY (), 0.0f );
4694
+ assertEquals (20f , root_child0_child0_child1 .getLayoutWidth (), 0.0f );
4695
+ assertEquals (92f , root_child0_child0_child1 .getLayoutHeight (), 0.0f );
4696
+
4697
+ assertEquals (16f , root_child0_child0_child1_child0 .getLayoutX (), 0.0f );
4698
+ assertEquals (16f , root_child0_child0_child1_child0 .getLayoutY (), 0.0f );
4699
+ assertEquals (100f , root_child0_child0_child1_child0 .getLayoutWidth (), 0.0f );
4700
+ assertEquals (50f , root_child0_child0_child1_child0 .getLayoutHeight (), 0.0f );
4701
+
4702
+ assertEquals (18f , root_child0_child0_child2 .getLayoutX (), 0.0f );
4703
+ assertEquals (140f , root_child0_child0_child2 .getLayoutY (), 0.0f );
4704
+ assertEquals (20f , root_child0_child0_child2 .getLayoutWidth (), 0.0f );
4705
+ assertEquals (92f , root_child0_child0_child2 .getLayoutHeight (), 0.0f );
4706
+
4707
+ assertEquals (16f , root_child0_child0_child2_child0 .getLayoutX (), 0.0f );
4708
+ assertEquals (16f , root_child0_child0_child2_child0 .getLayoutY (), 0.0f );
4709
+ assertEquals (100f , root_child0_child0_child2_child0 .getLayoutWidth (), 0.0f );
4710
+ assertEquals (50f , root_child0_child0_child2_child0 .getLayoutHeight (), 0.0f );
4711
+
4712
+ root .setDirection (YogaDirection .RTL );
4713
+ root .calculateLayout (YogaConstants .UNDEFINED , YogaConstants .UNDEFINED );
4714
+
4715
+ assertEquals (0f , root .getLayoutX (), 0.0f );
4716
+ assertEquals (0f , root .getLayoutY (), 0.0f );
4717
+ assertEquals (215f , root .getLayoutWidth (), 0.0f );
4718
+ assertEquals (301f , root .getLayoutHeight (), 0.0f );
4719
+
4720
+ assertEquals (4f , root_child0 .getLayoutX (), 0.0f );
4721
+ assertEquals (5f , root_child0 .getLayoutY (), 0.0f );
4722
+ assertEquals (202f , root_child0 .getLayoutWidth (), 0.0f );
4723
+ assertEquals (295f , root_child0 .getLayoutHeight (), 0.0f );
4724
+
4725
+ assertEquals (15f , root_child0_child0 .getLayoutX (), 0.0f );
4726
+ assertEquals (21f , root_child0_child0 .getLayoutY (), 0.0f );
4727
+ assertEquals (166f , root_child0_child0 .getLayoutWidth (), 0.0f );
4728
+ assertEquals (244f , root_child0_child0 .getLayoutHeight (), 0.0f );
4729
+
4730
+ assertEquals (111f , root_child0_child0_child0 .getLayoutX (), 0.0f );
4731
+ assertEquals (140f , root_child0_child0_child0 .getLayoutY (), 0.0f );
4732
+ assertEquals (40f , root_child0_child0_child0 .getLayoutWidth (), 0.0f );
4733
+ assertEquals (92f , root_child0_child0_child0 .getLayoutHeight (), 0.0f );
4734
+
4735
+ assertEquals (-77f , root_child0_child0_child0_child0 .getLayoutX (), 0.0f );
4736
+ assertEquals (16f , root_child0_child0_child0_child0 .getLayoutY (), 0.0f );
4737
+ assertEquals (100f , root_child0_child0_child0_child0 .getLayoutWidth (), 0.0f );
4738
+ assertEquals (50f , root_child0_child0_child0_child0 .getLayoutHeight (), 0.0f );
4739
+
4740
+ assertEquals (131f , root_child0_child0_child1 .getLayoutX (), 0.0f );
4741
+ assertEquals (29f , root_child0_child0_child1 .getLayoutY (), 0.0f );
4742
+ assertEquals (20f , root_child0_child0_child1 .getLayoutWidth (), 0.0f );
4743
+ assertEquals (92f , root_child0_child0_child1 .getLayoutHeight (), 0.0f );
4744
+
4745
+ assertEquals (-97f , root_child0_child0_child1_child0 .getLayoutX (), 0.0f );
4746
+ assertEquals (16f , root_child0_child0_child1_child0 .getLayoutY (), 0.0f );
4747
+ assertEquals (100f , root_child0_child0_child1_child0 .getLayoutWidth (), 0.0f );
4748
+ assertEquals (50f , root_child0_child0_child1_child0 .getLayoutHeight (), 0.0f );
4749
+
4750
+ assertEquals (131f , root_child0_child0_child2 .getLayoutX (), 0.0f );
4751
+ assertEquals (140f , root_child0_child0_child2 .getLayoutY (), 0.0f );
4752
+ assertEquals (20f , root_child0_child0_child2 .getLayoutWidth (), 0.0f );
4753
+ assertEquals (92f , root_child0_child0_child2 .getLayoutHeight (), 0.0f );
4754
+
4755
+ assertEquals (-97f , root_child0_child0_child2_child0 .getLayoutX (), 0.0f );
4756
+ assertEquals (16f , root_child0_child0_child2_child0 .getLayoutY (), 0.0f );
4757
+ assertEquals (100f , root_child0_child0_child2_child0 .getLayoutWidth (), 0.0f );
4758
+ assertEquals (50f , root_child0_child0_child2_child0 .getLayoutHeight (), 0.0f );
4759
+ }
4760
+
4520
4761
private YogaNode createNode (YogaConfig config ) {
4521
4762
return mNodeFactory .create (config );
4522
4763
}
0 commit comments