bevyengine / bevyengine/bevy

Generic geometric types

Open
#8,540 1 comment 0 reactions 0 assignees View on GitHub
A-Math C-Feature
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## 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` 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` and `GenericSize` 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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.