Skip to content

Text draws outside bounds in 0.14 if Wrapping::None #3150

@joshsharp

Description

@joshsharp

Is your issue REALLY a bug?

  • My issue is indeed a bug!
  • I am not crazy! I will not fill out this form just to ask a question or request a feature. Pinky promise.

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

I'm laying out a bunch of text widgets inside a row, in order to mimic a table layout where I need text to truncate if it's too long rather than wrap. I've upgraded from 0.13.1 to 0.14 and now if the text is too long for its bounds with Wrapping::None, it'll keep drawing to the right, over the contents of the next text.

E.g.

row![
    text("A very long track title that keeps going and going and going")
        .width(90)
        .wrapping(text::Wrapping::None),
    text("A very long artist name that also keeps going")
        .width(FillPortion(1))
        .wrapping(text::Wrapping::None),
    text("02:00").width(60).wrapping(text::Wrapping::None),
]

When the parent width is small enough, the track title will draw over the artist name, and so on. I'm fairly sure this isn't an issue specifically with FillPortion, it seems to occur when setting an explicit width also.

What is the expected behavior?

I was expecting the behavour of 0.13 where text is truncated at its bounds. (I mean, I'd love if it ellipsised, but truncation is totally fine.)

Sorry if I've missed something! I can't find anything new in the docs to control clipping to bounds for text.

Version

crates.io release

Operating System

Windows

Do you have any log output?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions