Clean up litany text label
This commit is contained in:
parent
4f5e93e182
commit
1b6b97243b
1 changed files with 2 additions and 1 deletions
|
|
@ -1622,7 +1622,7 @@ private fun TuoEditDialogWrapper(
|
||||||
|
|
||||||
fun fitLitanyLabel(
|
fun fitLitanyLabel(
|
||||||
stars: String,
|
stars: String,
|
||||||
text: String,
|
rawText: String,
|
||||||
textMeasurer: TextMeasurer,
|
textMeasurer: TextMeasurer,
|
||||||
style: TextStyle,
|
style: TextStyle,
|
||||||
maxWidthPx: Float
|
maxWidthPx: Float
|
||||||
|
|
@ -1630,6 +1630,7 @@ fun fitLitanyLabel(
|
||||||
fun widthOf(s: String): Int =
|
fun widthOf(s: String): Int =
|
||||||
textMeasurer.measure(text = s, style = style, maxLines = 1, softWrap = false).size.width
|
textMeasurer.measure(text = s, style = style, maxLines = 1, softWrap = false).size.width
|
||||||
|
|
||||||
|
val text = rawText.replace(Regex("[_/]"), "")
|
||||||
val full = stars + text
|
val full = stars + text
|
||||||
if (widthOf(full) <= maxWidthPx) return full
|
if (widthOf(full) <= maxWidthPx) return full
|
||||||
var end = text.length
|
var end = text.length
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue