From 960a379367f97436bd897e6e7850255943003d6a Mon Sep 17 00:00:00 2001 From: skydoves Date: Sun, 3 Nov 2024 17:30:42 +0900 Subject: [PATCH] Fix measuring text width size to limit with displayWidth --- balloon/src/main/kotlin/com/skydoves/balloon/Balloon.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/balloon/src/main/kotlin/com/skydoves/balloon/Balloon.kt b/balloon/src/main/kotlin/com/skydoves/balloon/Balloon.kt index 6117bda9..f4d9a8c4 100644 --- a/balloon/src/main/kotlin/com/skydoves/balloon/Balloon.kt +++ b/balloon/src/main/kotlin/com/skydoves/balloon/Balloon.kt @@ -1958,7 +1958,7 @@ public class Balloon private constructor( } else { 0 + builder.marginRight + builder.marginLeft + (builder.arrowSize * 2) } - val maxTextWidth = builder.maxWidth - spaces + val maxTextWidth = (builder.maxWidth - spaces).coerceAtMost(displayWidth) return when { builder.widthRatio != NO_Float_VALUE ->