Skip to content

Commit d871c04

Browse files
authored
Merge pull request #751 from skydoves/fix/getMeasuredTextWidth
Fix measuring text width size to limit with displayWidth
2 parents a93c4cb + 960a379 commit d871c04

File tree

1 file changed

+1
-1
lines changed
  • balloon/src/main/kotlin/com/skydoves/balloon

1 file changed

+1
-1
lines changed

balloon/src/main/kotlin/com/skydoves/balloon/Balloon.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,7 @@ public class Balloon private constructor(
19581958
} else {
19591959
0 + builder.marginRight + builder.marginLeft + (builder.arrowSize * 2)
19601960
}
1961-
val maxTextWidth = builder.maxWidth - spaces
1961+
val maxTextWidth = (builder.maxWidth - spaces).coerceAtMost(displayWidth)
19621962

19631963
return when {
19641964
builder.widthRatio != NO_Float_VALUE ->

0 commit comments

Comments
 (0)