Improve rendering of Text composer regarding fontScale. (#984)
This commit is contained in:
parent
3c1f764bee
commit
3c07fea2dd
2 changed files with 25 additions and 13 deletions
|
|
@ -60,3 +60,11 @@ fun Dp.roundToPx(): Int = with(LocalDensity.current) { roundToPx() }
|
|||
fun Dp.scaleMax(): Dp = with(LocalDensity.current) {
|
||||
return this@scaleMax * fontScale.coerceAtMost(1f)
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the minimum value between the receiver value and the value with fonScale applied.
|
||||
*/
|
||||
@Composable
|
||||
fun Dp.scaleMin(): Dp = with(LocalDensity.current) {
|
||||
return this@scaleMin * fontScale.coerceAtLeast(1f)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue