mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 20:53:53 +00:00
960e797388
# Objective Make the UI code more concise. ## Solution Add two utility methods to make manipulating `UiRect` from code more concise: - `UiRect::px()` create a new `UiRect` like the `new()` function, but with values in logical pixels directly. - `UiRect::percent()` is similar, with values as percentages. This saves a lot of typing and makes UI code more compact while retaining readability. --- ## Changelog ### Added Added two new constructors `UiRect::px()` and `UiRect::percent()` to create a new `UiRect` from values directly specified in logical pixels and percentages, respectively. The argument order is the same as `UiRect::new()`, but avoids having to repeat `Val::Px` and `Val::Percent`, respectively. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |