@@ -545,7 +545,7 @@ public final class Flex {
545
545
}
546
546
547
547
//
548
- // MARK: Position / Insets
548
+ // MARK: Position / Inset
549
549
//
550
550
551
551
/**
@@ -561,7 +561,7 @@ public final class Flex {
561
561
562
562
/**
563
563
Set the left edge distance from the container left edge in pixels.
564
- This method is valid only when the item position is absolute (`view.flex. position(.absolute)`)
564
+ This method is valid only when the item position is absolute or relative. It is not valid when the position is static.
565
565
*/
566
566
@discardableResult
567
567
public func left( _ value: CGFloat ) -> Flex {
@@ -571,7 +571,7 @@ public final class Flex {
571
571
572
572
/**
573
573
Set the left edge distance from the container left edge in percentage of its container width.
574
- This method is valid only when the item position is absolute (`view.flex. position(.absolute)`)
574
+ This method is valid only when the item position is absolute or relative. It is not valid when the position is static.
575
575
*/
576
576
@discardableResult
577
577
public func left( _ percent: FPercent ) -> Flex {
@@ -581,6 +581,7 @@ public final class Flex {
581
581
582
582
/**
583
583
Set the top edge distance from the container top edge in pixels.
584
+ This method is valid only when the item position is absolute or relative. It is not valid when the position is static.
584
585
*/
585
586
@discardableResult
586
587
public func top( _ value: CGFloat ) -> Flex {
@@ -590,7 +591,7 @@ public final class Flex {
590
591
591
592
/**
592
593
Set the top edge distance from the container top edge in percentage of its container height.
593
- This method is valid only when the item position is absolute (`view.flex. position(.absolute)`)
594
+ This method is valid only when the item position is absolute or relative. It is not valid when the position is static.
594
595
*/
595
596
@discardableResult
596
597
public func top( _ percent: FPercent ) -> Flex {
@@ -600,7 +601,7 @@ public final class Flex {
600
601
601
602
/**
602
603
Set the right edge distance from the container right edge in pixels.
603
- This method is valid only when the item position is absolute (`view.flex. position(.absolute)`)
604
+ This method is valid only when the item position is absolute or relative. It is not valid when the position is static.
604
605
*/
605
606
@discardableResult
606
607
public func right( _ value: CGFloat ) -> Flex {
@@ -610,7 +611,7 @@ public final class Flex {
610
611
611
612
/**
612
613
Set the right edge distance from the container right edge in percentage of its container width.
613
- This method is valid only when the item position is absolute (`view.flex. position(.absolute)`)
614
+ This method is valid only when the item position is absolute or relative. It is not valid when the position is static.
614
615
*/
615
616
@discardableResult
616
617
public func right( _ percent: FPercent ) -> Flex {
@@ -620,7 +621,7 @@ public final class Flex {
620
621
621
622
/**
622
623
Set the bottom edge distance from the container bottom edge in pixels.
623
- This method is valid only when the item position is absolute (`view.flex. position(.absolute)`)
624
+ This method is valid only when the item position is absolute or relative. It is not valid when the position is static.
624
625
*/
625
626
@discardableResult
626
627
public func bottom( _ value: CGFloat ) -> Flex {
@@ -630,7 +631,7 @@ public final class Flex {
630
631
631
632
/**
632
633
Set the bottom edge distance from the container bottom edge in percentage of its container height.
633
- This method is valid only when the item position is absolute (`view.flex. position(.absolute)`)
634
+ This method is valid only when the item position is absolute or relative. It is not valid when the position is static.
634
635
*/
635
636
@discardableResult
636
637
public func bottom( _ percent: FPercent ) -> Flex {
@@ -640,7 +641,7 @@ public final class Flex {
640
641
641
642
/**
642
643
Set the start edge (LTR=left, RTL=right) distance from the container start edge in pixels.
643
- This method is valid only when the item position is absolute (`view.flex. position(.absolute)`)
644
+ This method is valid only when the item position is absolute or relative. It is not valid when the position is static.
644
645
*/
645
646
@discardableResult
646
647
public func start( _ value: CGFloat ) -> Flex {
@@ -651,7 +652,7 @@ public final class Flex {
651
652
/**
652
653
Set the start edge (LTR=left, RTL=right) distance from the container start edge in
653
654
percentage of its container width.
654
- This method is valid only when the item position is absolute (`view.flex. position(.absolute)`)
655
+ This method is valid only when the item position is absolute or relative. It is not valid when the position is static.
655
656
*/
656
657
@discardableResult
657
658
public func start( _ percent: FPercent ) -> Flex {
@@ -661,7 +662,7 @@ public final class Flex {
661
662
662
663
/**
663
664
Set the end edge (LTR=right, RTL=left) distance from the container end edge in pixels.
664
- This method is valid only when the item position is absolute (`view.flex. position(.absolute)`)
665
+ This method is valid only when the item position is absolute or relative. It is not valid when the position is static.
665
666
*/
666
667
@discardableResult
667
668
public func end( _ value: CGFloat ) -> Flex {
@@ -672,7 +673,7 @@ public final class Flex {
672
673
/**
673
674
Set the end edge (LTR=right, RTL=left) distance from the container end edge in
674
675
percentage of its container width.
675
- This method is valid only when the item position is absolute (`view.flex. position(.absolute)`)
676
+ This method is valid only when the item position is absolute or relative. It is not valid when the position is static.
676
677
*/
677
678
@discardableResult
678
679
public func end( _ percent: FPercent ) -> Flex {
@@ -681,20 +682,22 @@ public final class Flex {
681
682
}
682
683
683
684
/**
684
- Set the left and right edges distance from the container edges in pixels.
685
- This method is valid only when the item position is absolute (`view.flex.position(.absolute)`)
686
- */
685
+ Set the left and right edges distance from the container edges in pixels.
686
+ This method is valid only when the item position is absolute or relative. It is not valid when the position is static.
687
+ For relative position, the right edge will be ignored.
688
+ */
687
689
@discardableResult
688
690
public func horizontally( _ value: CGFloat ) -> Flex {
689
691
yoga. left = YGValue ( value)
690
692
yoga. right = YGValue ( value)
691
693
return self
692
694
}
693
695
694
- /**
695
- Set the left and right edges distance from the container edges in percentage of its container width.
696
- This method is valid only when the item position is absolute (`view.flex.position(.absolute)`)
697
- */
696
+ /**
697
+ Set the left and right edges distance from the container edges in percentage of its container width.
698
+ This method is valid only when the item position is absolute or relative. It is not valid when the position is static.
699
+ For relative position, the right edge will be ignored.
700
+ */
698
701
@discardableResult
699
702
public func horizontally( _ percent: FPercent ) -> Flex {
700
703
yoga. left = YGValue ( value: Float ( percent. value) , unit: . percent)
@@ -704,7 +707,8 @@ public final class Flex {
704
707
705
708
/**
706
709
Set the top and bottom edges distance from the container edges in pixels.
707
- This method is valid only when the item position is absolute (`view.flex.position(.absolute)`)
710
+ This method is valid only when the item position is absolute or relative. It is not valid when the position is static.
711
+ For relative position, the bottom edge will be ignored.
708
712
*/
709
713
@discardableResult
710
714
public func vertically( _ value: CGFloat ) -> Flex {
@@ -715,7 +719,8 @@ public final class Flex {
715
719
716
720
/**
717
721
Set the top and bottom edges distance from the container edges in percentage of its container height.
718
- This method is valid only when the item position is absolute (`view.flex.position(.absolute)`)
722
+ This method is valid only when the item position is absolute or relative. It is not valid when the position is static.
723
+ For relative position, the bottom edge will be ignored.
719
724
*/
720
725
@discardableResult
721
726
public func vertically( _ percent: FPercent ) -> Flex {
@@ -726,7 +731,8 @@ public final class Flex {
726
731
727
732
/**
728
733
Set all edges distance from the container edges in pixels.
729
- This method is valid only when the item position is absolute (`view.flex.position(.absolute)`)
734
+ This method is valid only when the item position is absolute or relative. It is not valid when the position is static.
735
+ For relative position, the bottom and right edges will be ignored.
730
736
*/
731
737
@discardableResult
732
738
public func all( _ value: CGFloat ) -> Flex {
@@ -739,7 +745,8 @@ public final class Flex {
739
745
740
746
/**
741
747
Set all edges distance from the container edges in percentage of its container size.
742
- This method is valid only when the item position is absolute (`view.flex.position(.absolute)`)
748
+ This method is valid only when the item position is absolute or relative. It is not valid when the position is static.
749
+ For relative position, the bottom and right edges will be ignored.
743
750
*/
744
751
@discardableResult
745
752
public func all( _ percent: FPercent ) -> Flex {
0 commit comments