Skip to content

In a wrapping layout a label that ends with a newline character adds superfluous item spacing #2793

Open
@bu5hm4nn

Description

@bu5hm4nn

Describe the bug
Whenever a label ends with a newline character in a wrapping layout, the next label will have an indent equal to item_spacing.x.

To Reproduce
Adding this code to any ui should reproduce the error on the second line:

ui.horizontal_wrapped(|ui| {
    ui.label("Text ends with a newline\n");
    ui.label("Some other text, no newline");
    ui.label("next label");
    ui.end_row(); // start over
    ui.label("Text that continues\nafter a newline is fine");
});

Expected behavior
Every newline character should behave the same way.

Screenshots
Screenshot 2023-03-08 at 15 15 09

Desktop (please complete the following information):

  • OS: macOS
  • Browser not tested
  • Version master-branch

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is brokenlayoutRelated to widget layouttextProblems related to text

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions