bevy/examples/animation
robtfm b641aa0ecf
separate border colors (#18682)
# Objective

allow specifying the left/top/right/bottom border colors separately for
ui elements

fixes #14773

## Solution

- change `BorderColor` to 
```rs
pub struct BorderColor {
    pub left: Color,
    pub top: Color,
    pub right: Color,
    pub bottom: Color,
}
```
- generate one ui node per distinct border color, set flags for the
active borders
- render only the active borders

i chose to do this rather than adding multiple colors to the
ExtractedUiNode in order to minimize the impact for the common case
where all border colors are the same.

## Testing

modified the `borders` example to use separate colors:


![image](https://github.com/user-attachments/assets/5d9a4492-429a-4ee1-9656-215511886164)

the behaviour is a bit weird but it mirrors html/css border behaviour.

---

## Migration:

To keep the existing behaviour, just change `BorderColor(color)` into
`BorderColor::all(color)`.

---------

Co-authored-by: ickshonpe <david.curthoys@googlemail.com>
2025-05-26 16:57:13 +00:00
..
animated_mesh_control.rs Revert "Replace Ambient Lights with Environment Map Lights (#17482)" (#18167) 2025-03-05 23:08:46 +00:00
animated_mesh_events.rs Revert "Replace Ambient Lights with Environment Map Lights (#17482)" (#18167) 2025-03-05 23:08:46 +00:00
animated_mesh.rs Revert "Replace Ambient Lights with Environment Map Lights (#17482)" (#18167) 2025-03-05 23:08:46 +00:00
animated_transform.rs Revert "Replace Ambient Lights with Environment Map Lights (#17482)" (#18167) 2025-03-05 23:08:46 +00:00
animated_ui.rs Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00
animation_events.rs AnimationEvent -> Event and other improvements (#16440) 2024-11-22 00:16:04 +00:00
animation_graph.rs separate border colors (#18682) 2025-05-26 16:57:13 +00:00
animation_masks.rs separate border colors (#18682) 2025-05-26 16:57:13 +00:00
color_animation.rs ✏️ Fix typos across bevy (#16702) 2024-12-08 01:18:39 +00:00
custom_skinned_mesh.rs Revert "Replace Ambient Lights with Environment Map Lights (#17482)" (#18167) 2025-03-05 23:08:46 +00:00
eased_motion.rs AnimatedField and Rework Evaluators (#16484) 2024-11-27 22:19:55 +00:00
easing_functions.rs Add ways to configure EasingFunction::Steps via new StepConfig (#17752) 2025-02-11 22:19:01 +00:00
gltf_skinned_mesh.rs Switch ChildOf back to tuple struct (#18672) 2025-04-02 00:10:10 +00:00
morph_targets.rs Revert "Replace Ambient Lights with Environment Map Lights (#17482)" (#18167) 2025-03-05 23:08:46 +00:00