Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# 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.
- Loading branch information