Skip to content

Commit

Permalink
sometimes it wraps even if maxIntrinsicWidth isn't round
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeevPavel committed Oct 29, 2024
1 parent 91f204b commit 797475c
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,7 @@ class ParagraphTest {
assertEquals(1, paragraph.lineNumber, "Layout in one line with Inf width")

val maxIntrinsicWidth = paragraph.maxIntrinsicWidth
val isMaxIntrinsicWidthRound = maxIntrinsicWidth == truncate(maxIntrinsicWidth)
val expectedLines = if (unexpectedWrapsPresent && isMaxIntrinsicWidthRound) 2 else 1
val expectedLines = if (unexpectedWrapsPresent) 2 else 1

paragraph.layout(ceil(paragraph.maxIntrinsicWidth))
assertEquals(expectedLines, paragraph.lineNumber, "Layout with ceil(maxIntrinsicWidth) " +
Expand Down

0 comments on commit 797475c

Please sign in to comment.