Skip to content

Commit

Permalink
Tiny changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhuy committed Oct 11, 2018
1 parent fbd6276 commit 24365db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/ASTextNode2.mm
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ - (CGSize)calculateSizeThatFits:(CGSize)constrainedSize
_textContainer.size = constrainedSize;
[self _ensureTruncationText];

// If the constrained size has max/inf value on the text's forward direction, the text node is calculating its intrinsic size.
// If the constrained size has a max/inf value on the text's forward direction, the text node is calculating its intrinsic size.
BOOL isCalculatingIntrinsicSize;
if (_textContainer.isVerticalForm) {
isCalculatingIntrinsicSize = (_textContainer.size.height >= ASTextContainerMaxSize.height);
Expand Down Expand Up @@ -338,7 +338,7 @@ - (void)prepareAttributedString:(NSMutableAttributedString *)attributedString is

const BOOL applyTruncationMode = (style != nil && style.lineBreakMode != _truncationMode);
// Only "left" and "justified" alignments are supported while calculating intrinsic size.
// Other alignments such as "right" and "center" causes the text to be bigger than needed and thus should be ignored/overridden.
// Other alignments like "right", "center" and "natural" cause the size to be bigger than needed and thus should be ignored/overridden.
const BOOL forceLeftAlignment = (style != nil
&& isForIntrinsicSize
&& style.alignment != NSTextAlignmentLeft
Expand Down

0 comments on commit 24365db

Please sign in to comment.