Skip to content

Commit

Permalink
Fix shadowed var warning (and add clarity) #trivial (#1198)
Browse files Browse the repository at this point in the history
* Fix shadowed var warning (and add clarity)

* Update ASTextLayout.m
  • Loading branch information
wiseoldduck authored and maicki committed Oct 29, 2018
1 parent 959dafc commit 6ea7f06
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/Private/TextExperiment/Component/ASTextLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ + (ASTextLayout *)layoutWithContainer:(ASTextContainer *)container text:(NSAttri
// Give user a chance to modify the line's position.
[container.linePositionModifier modifyLines:lines fromText:text inContainer:container];

NSUInteger i = 0;
BOOL first = YES;
for (ASTextLine *line in lines) {
CGPoint position = line.position;
CGRect rect = line.bounds;
Expand Down Expand Up @@ -668,7 +668,8 @@ + (ASTextLayout *)layoutWithContainer:(ASTextContainer *)container text:(NSAttri
rowCount = rowIdx + 1;
lineCurrentIdx ++;

if (i++ == 0) {
if (first) {
first = NO;
textBoundingRect = rect;
} else if (!measuringBeyondConstraints) {
if (maximumNumberOfRows == 0 || rowIdx < maximumNumberOfRows) {
Expand Down

0 comments on commit 6ea7f06

Please sign in to comment.