Skip to content

Commit b06718f

Browse files
committed
Update inset comment
1 parent fe28ae1 commit b06718f

File tree

1 file changed

+30
-23
lines changed

1 file changed

+30
-23
lines changed

Sources/Swift/FlexLayout.swift

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ public final class Flex {
545545
}
546546

547547
//
548-
// MARK: Position / Insets
548+
// MARK: Position / Inset
549549
//
550550

551551
/**
@@ -561,7 +561,7 @@ public final class Flex {
561561

562562
/**
563563
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.
565565
*/
566566
@discardableResult
567567
public func left(_ value: CGFloat) -> Flex {
@@ -571,7 +571,7 @@ public final class Flex {
571571

572572
/**
573573
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.
575575
*/
576576
@discardableResult
577577
public func left(_ percent: FPercent) -> Flex {
@@ -581,6 +581,7 @@ public final class Flex {
581581

582582
/**
583583
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.
584585
*/
585586
@discardableResult
586587
public func top(_ value: CGFloat) -> Flex {
@@ -590,7 +591,7 @@ public final class Flex {
590591

591592
/**
592593
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.
594595
*/
595596
@discardableResult
596597
public func top(_ percent: FPercent) -> Flex {
@@ -600,7 +601,7 @@ public final class Flex {
600601

601602
/**
602603
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.
604605
*/
605606
@discardableResult
606607
public func right(_ value: CGFloat) -> Flex {
@@ -610,7 +611,7 @@ public final class Flex {
610611

611612
/**
612613
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.
614615
*/
615616
@discardableResult
616617
public func right(_ percent: FPercent) -> Flex {
@@ -620,7 +621,7 @@ public final class Flex {
620621

621622
/**
622623
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.
624625
*/
625626
@discardableResult
626627
public func bottom(_ value: CGFloat) -> Flex {
@@ -630,7 +631,7 @@ public final class Flex {
630631

631632
/**
632633
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.
634635
*/
635636
@discardableResult
636637
public func bottom(_ percent: FPercent) -> Flex {
@@ -640,7 +641,7 @@ public final class Flex {
640641

641642
/**
642643
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.
644645
*/
645646
@discardableResult
646647
public func start(_ value: CGFloat) -> Flex {
@@ -651,7 +652,7 @@ public final class Flex {
651652
/**
652653
Set the start edge (LTR=left, RTL=right) distance from the container start edge in
653654
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.
655656
*/
656657
@discardableResult
657658
public func start(_ percent: FPercent) -> Flex {
@@ -661,7 +662,7 @@ public final class Flex {
661662

662663
/**
663664
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.
665666
*/
666667
@discardableResult
667668
public func end(_ value: CGFloat) -> Flex {
@@ -672,7 +673,7 @@ public final class Flex {
672673
/**
673674
Set the end edge (LTR=right, RTL=left) distance from the container end edge in
674675
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.
676677
*/
677678
@discardableResult
678679
public func end(_ percent: FPercent) -> Flex {
@@ -681,20 +682,22 @@ public final class Flex {
681682
}
682683

683684
/**
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+
*/
687689
@discardableResult
688690
public func horizontally(_ value: CGFloat) -> Flex {
689691
yoga.left = YGValue(value)
690692
yoga.right = YGValue(value)
691693
return self
692694
}
693695

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+
*/
698701
@discardableResult
699702
public func horizontally(_ percent: FPercent) -> Flex {
700703
yoga.left = YGValue(value: Float(percent.value), unit: .percent)
@@ -704,7 +707,8 @@ public final class Flex {
704707

705708
/**
706709
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.
708712
*/
709713
@discardableResult
710714
public func vertically(_ value: CGFloat) -> Flex {
@@ -715,7 +719,8 @@ public final class Flex {
715719

716720
/**
717721
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.
719724
*/
720725
@discardableResult
721726
public func vertically(_ percent: FPercent) -> Flex {
@@ -726,7 +731,8 @@ public final class Flex {
726731

727732
/**
728733
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.
730736
*/
731737
@discardableResult
732738
public func all(_ value: CGFloat) -> Flex {
@@ -739,7 +745,8 @@ public final class Flex {
739745

740746
/**
741747
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.
743750
*/
744751
@discardableResult
745752
public func all(_ percent: FPercent) -> Flex {

0 commit comments

Comments
 (0)