File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
balloon-compose/src/main/kotlin/com/skydoves/balloon/compose Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -132,11 +132,18 @@ public fun Balloon(
132
132
.padding(start = paddingStart, end = paddingEnd)
133
133
.onGloballyPositioned { coordinates ->
134
134
val originalSize = coordinates.size
135
- val calculatedWidth = if (originalSize.width > screenWidth) {
136
- screenWidth
137
- } else {
138
- originalSize.width
139
- }
135
+ val calculatedWidth =
136
+ if (screenWidth * builder.widthRatio != 0f ) {
137
+ (
138
+ screenWidth * builder.widthRatio -
139
+ with (density) { builder.marginRight.dp.toPx() } -
140
+ with (density) { builder.marginLeft.dp.toPx() }
141
+ ).toInt()
142
+ } else if (originalSize.width > screenWidth) {
143
+ screenWidth
144
+ } else {
145
+ originalSize.width
146
+ }
140
147
val size = IntSize (
141
148
width = calculatedWidth,
142
149
height = coordinates.size.height,
Original file line number Diff line number Diff line change 1
1
[versions ]
2
- agp = " 8.7.0 "
2
+ agp = " 8.6.1 "
3
3
dokka = " 1.9.20"
4
4
kotlin = " 2.0.20"
5
5
kotlinBinaryCompatibility = " 0.16.3"
You can’t perform that action at this time.
0 commit comments