Skip to content
This repository was archived by the owner on Mar 28, 2025. It is now read-only.
This repository was archived by the owner on Mar 28, 2025. It is now read-only.

Larger fonts cause line offset errors #19

@WilfulTravesty

Description

@WilfulTravesty

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions