bevy/examples/3d
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
..
3d_scene.rs
3d_shapes.rs Add binned 2d/3d Wireframe render phase (#18587) 2025-04-09 21:34:53 +00:00
3d_viewport_to_world.rs Make Query::single (and friends) return a Result (#18082) 2025-03-02 19:51:56 +00:00
animated_material.rs
anisotropy.rs Add a Sphere to anisotropy example (#17676) 2025-02-05 20:23:43 +00:00
anti_aliasing.rs Add bevy_anti_aliasing (#18323) 2025-03-19 18:40:32 +00:00
atmosphere.rs Procedural atmospheric scattering (#16314) 2025-01-23 22:52:46 +00:00
atmospheric_fog.rs
auto_exposure.rs Revert "Replace Ambient Lights with Environment Map Lights (#17482)" (#18167) 2025-03-05 23:08:46 +00:00
blend_modes.rs
bloom_3d.rs Anamorphic Bloom (#17096) 2025-01-06 18:43:21 +00:00
camera_sub_view.rs
clearcoat.rs
clustered_decals.rs Disable clustered decals on Metal. (#17554) 2025-01-27 05:39:07 +00:00
color_grading.rs separate border colors (#18682) 2025-05-26 16:57:13 +00:00
decal.rs Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
deferred_rendering.rs Add bevy_anti_aliasing (#18323) 2025-03-19 18:40:32 +00:00
depth_of_field.rs Add GltfMeshName component and Deref implementations (#19331) 2025-05-23 20:56:48 +00:00
edit_material_on_gltf.rs Add edit_material_on_gltf example (#17677) 2025-02-05 22:45:20 +00:00
fog_volumes.rs Revert "Replace Ambient Lights with Environment Map Lights (#17482)" (#18167) 2025-03-05 23:08:46 +00:00
fog.rs Revert "Replace Ambient Lights with Environment Map Lights (#17482)" (#18167) 2025-03-05 23:08:46 +00:00
generate_custom_mesh.rs Make Query::single (and friends) return a Result (#18082) 2025-03-02 19:51:56 +00:00
irradiance_volumes.rs Revert "Replace Ambient Lights with Environment Map Lights (#17482)" (#18167) 2025-03-05 23:08:46 +00:00
lighting.rs Revert "Replace Ambient Lights with Environment Map Lights (#17482)" (#18167) 2025-03-05 23:08:46 +00:00
lightmaps.rs Add GltfMeshName component and Deref implementations (#19331) 2025-05-23 20:56:48 +00:00
lines.rs
load_gltf_extras.rs
load_gltf.rs aligning public apis of Time,Timer and Stopwatch (#15962) 2024-10-16 21:09:32 +00:00
mesh_ray_cast.rs
meshlet.rs
mixed_lighting.rs Add GltfMeshName component and Deref implementations (#19331) 2025-05-23 20:56:48 +00:00
motion_blur.rs Remove WebGL padding from MotionBlur (#18727) 2025-04-06 20:00:59 +00:00
occlusion_culling.rs Adopt consistent FooSystems naming convention for system sets (#18900) 2025-05-06 15:18:03 +00:00
order_independent_transparency.rs Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00
orthographic.rs
parallax_mapping.rs
parenting.rs
pbr.rs
pcss.rs Add bevy_anti_aliasing (#18323) 2025-03-19 18:40:32 +00:00
post_processing.rs
query_gltf_primitives.rs
reflection_probes.rs
render_to_texture.rs
rotate_environment_map.rs
scrolling_fog.rs Add bevy_anti_aliasing (#18323) 2025-03-19 18:40:32 +00:00
shadow_biases.rs Fix shadow_biases example (#18303) 2025-03-14 19:50:49 +00:00
shadow_caster_receiver.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
skybox.rs Revert "Replace Ambient Lights with Environment Map Lights (#17482)" (#18167) 2025-03-05 23:08:46 +00:00
specular_tint.rs Revert "Replace Ambient Lights with Environment Map Lights (#17482)" (#18167) 2025-03-05 23:08:46 +00:00
spherical_area_lights.rs Revert "Replace Ambient Lights with Environment Map Lights (#17482)" (#18167) 2025-03-05 23:08:46 +00:00
split_screen.rs separate border colors (#18682) 2025-05-26 16:57:13 +00:00
spotlight.rs Revert "Replace Ambient Lights with Environment Map Lights (#17482)" (#18167) 2025-03-05 23:08:46 +00:00
ssao.rs Add bevy_anti_aliasing (#18323) 2025-03-19 18:40:32 +00:00
ssr.rs Add bevy_anti_aliasing (#18323) 2025-03-19 18:40:32 +00:00
texture.rs
tonemapping.rs Fix tonemapping example when using a local image (#19061) 2025-05-05 17:39:32 +00:00
transmission.rs Add bevy_anti_aliasing (#18323) 2025-03-19 18:40:32 +00:00
transparency_3d.rs Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
two_passes.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
update_gltf_scene.rs
vertex_colors.rs
visibility_range.rs Switch ChildOf back to tuple struct (#18672) 2025-04-02 00:10:10 +00:00
volumetric_fog.rs Revert "Replace Ambient Lights with Environment Map Lights (#17482)" (#18167) 2025-03-05 23:08:46 +00:00
wireframe.rs Add binned 2d/3d Wireframe render phase (#18587) 2025-04-09 21:34:53 +00:00