Skip to content

Commit

Permalink
Simplify else if and its following if in a single condition
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarX committed Nov 8, 2024
1 parent e1bd3ca commit a29eb9f
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,11 @@ private fun TextLayoutResult.getBoundingBoxesForRange(start: Int, end: Int): Lis

if (firstLineCharRect == null) {
firstLineCharRect = rect
} else if (previousRect != null) {
if (previousRect.bottom != rect.bottom || isLastRect) {
boundingBoxes.add(
firstLineCharRect.copy(right = previousRect.right)
)
firstLineCharRect = rect
}
} else if (previousRect != null && (previousRect.bottom != rect.bottom || isLastRect)) {
boundingBoxes.add(
firstLineCharRect.copy(right = previousRect.right)
)
firstLineCharRect = rect
}
previousRect = rect
}
Expand Down

0 comments on commit a29eb9f

Please sign in to comment.