| 1 |
--- |
| 2 |
title: "Elliptical Border Radius" |
| 3 |
authors: ["@ickshonpe"] |
| 4 |
pull_requests: [24779] |
| 5 |
--- |
| 6 |
|
| 7 |
Bevy UI can now draw Nodes with elliptical border geometry. |
| 8 |
|
| 9 |
The fields of `BorderRadius` are now `CornerRadius`s to enable different radius to be set for each axis. |
| 10 |
|
| 11 |
The `BorderRadius` constructor and update functions are no longer `const`, and their parameters take `Into<CornerRadius>`s instead of `Val`s. `CornerRadius` now implements `From<Val>` so most existing code using border radius shouldn't require changes: |
| 12 |
|
| 13 |
```rust |
| 14 |
let a = BorderRadius::all(CornerRadius::circular(vh(10.))); |
| 15 |
let b = BorderRadius::all(vh(10.)); // a == b |
| 16 |
let c = BorderRadius::top_right(CornerRadius::new(px(10.), px(20.))); |
| 17 |
``` |