File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
app/src/main/java/org/simple/clinic/summary/compose Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 35
35
36
36
- Display only languages supported by the selected country in the settings screen
37
37
38
+ ### Fixes
39
+
40
+ - Fix crash when displaying large statin risk percentage text
41
+
38
42
## 2025.04.07
39
43
40
44
### Internal
Original file line number Diff line number Diff line change @@ -157,10 +157,13 @@ fun RiskText(
157
157
val totalTextWidth = textWidth + with (LocalDensity .current) { 8 .dp.toPx() * 2 }
158
158
159
159
val calculatedOffsetX = midpoint - (totalTextWidth / 2 )
160
- val clampedOffsetX = calculatedOffsetX.coerceIn(
161
- 0f ,
162
- parentWidth - totalTextWidth - parentPadding
163
- )
160
+ val maxOffsetX = parentWidth - totalTextWidth - parentPadding
161
+ val clampedOffsetX = if (maxOffsetX >= 0f ) {
162
+ calculatedOffsetX.coerceIn(0f , maxOffsetX)
163
+ } else {
164
+ 0f
165
+ }
166
+
164
167
165
168
Text (
166
169
modifier = Modifier
You can’t perform that action at this time.
0 commit comments