Skip to content

BorderRect is ambiguous #21913

@ickshonpe

Description

@ickshonpe

What problem does this solve or what need does it fill?

Reviewer asked a question about the PR #21903 which made me realise this type is confusing.

In UI and world coordinates, “top” and “bottom” mean opposite things, so these fields are ambiguous. Anyone using BorderRect must decide themselves how to apply the vertical insets.

What solution would you like?

Resolve the ambiguity by replacing the directional BorderRect fields (left, right, top, bottom) with two Vec2 fields:

pub struct BorderRect {
    pub min: Vec2,
    pub max: Vec2,
}

Additional context

#15461
#15440

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-Code-QualityA section of code that is hard to understand or changeD-TrivialNice and easy! A great choice to get started with BevyS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions