Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Larger fonts cause line offset errors #19

Open
WilfulTravesty opened this issue Apr 10, 2023 · 0 comments
Open

Larger fonts cause line offset errors #19

WilfulTravesty opened this issue Apr 10, 2023 · 0 comments

Comments

@WilfulTravesty
Copy link

As the font size of the items increases via the textStyle parameter, the values and lines above and below the center value get further and further away from their expected locations. (Adding lineHeight to the TextStyle makes no difference.)

Reference Code:

    val possibleValues = (1945..1975).map { it.toString() }
    var state by remember { mutableStateOf(possibleValues[8]) }
    Spacer(modifier = Modifier.height(40.dp))
    ListItemPicker(
        label = { it },
        list = possibleValues,
        value = state,
        onValueChange = { state = it },
        textStyle = TextStyle(fontSize = 36.sp, fontWeight = FontWeight.Normal),
    )

Result at 16.dp font size:
image

Result at 24.dp font size:
image

Result at 36.dp font size:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant