Skip to content

Generic geometric types #8540

@ickshonpe

Description

@ickshonpe

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

We used to have generic Size and Rect types, but they were specialized (for good reasons IMO).

But it's left some ergonomic friction, especially with measures which take separate width and height Option<f32> and AvailableSpace values which be much cleaner with a generic size type that has map and zip methods like Taffy's Size type .

Also, it would be nice to have some sort of GenericSize<Physical> and GenericSize<Logical> for dealing with window resolutions and scalings.

What solution would you like?

Size could be renamed to UiSize and then name the new generic type Size. UiSize is a bit ugly though.

Otherwise, none of the alternative names I came up with like Dimensions, Extent, Measurements, etc seem super intuitive.

Maybe just Size2 would be okay?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-MathFundamental domain-agnostic mathematical operationsC-FeatureA new feature, making something new possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions