bevy/crates/bevy_ui/src
ickshonpe a0f5ea0d36
UI outlines radius (#15018)
# Objective

Fixes #13479

This also fixes the gaps you can sometimes observe in outlines
(screenshot from main, not this PR):

<img width="636" alt="outline-gaps"
src="https://github.com/user-attachments/assets/c11dae24-20f5-4aea-8ffc-1894ad2a2b79">

The outline around the last item in each section has vertical gaps. 

## Solution

Draw the outlines with corner radius using the existing border rendering
for uinodes. The outline radius is very simple to calculate. We just
take the computed border radius of the node, and if it's greater than
zero, add it to the distance from the edge of the node to the outer edge
of the node's outline.

---

## Showcase

<img width="634" alt="outlines-radius"
src="https://github.com/user-attachments/assets/1ecda26c-65c5-41ef-87e4-5d9171ddc3ae">

---------

Co-authored-by: Jan Hohenheim <jan@hohenheim.ch>
2024-09-04 22:30:16 +00:00
..
layout Ignore clicks on uinodes outside of rounded corners (#14957) 2024-09-03 12:38:59 +00:00
render UI outlines radius (#15018) 2024-09-04 22:30:16 +00:00
widget Don't reallocate scale factors in measure_text_system (#14999) 2024-09-02 17:01:59 +00:00
accessibility.rs Return Results from Camera's world/viewport conversion methods (#14989) 2024-09-03 19:45:15 +00:00
focus.rs Ignore clicks on uinodes outside of rounded corners (#14957) 2024-09-03 12:38:59 +00:00
geometry.rs Fix uses of "it's" vs "its". (#13033) 2024-04-19 18:17:31 +00:00
lib.rs Remove all existing system order ambiguities in DefaultPlugins (#15031) 2024-09-03 20:24:34 +00:00
measurement.rs Optimize UI text measurement (#15003) 2024-09-01 11:50:54 +00:00
node_bundles.rs Add BorderRadius field to ImageBundle (#14457) 2024-07-24 18:41:26 +00:00
picking_backend.rs Ignore clicks on uinodes outside of rounded corners (#14957) 2024-09-03 12:38:59 +00:00
stack.rs Merge BuildWorldChildren and BuildChildren traits. (#14052) 2024-07-01 14:29:39 +00:00
ui_material.rs Fix incorrect link in UiMaterial documentation (#12361) 2024-03-07 22:09:57 +00:00
ui_node.rs UI outlines radius (#15018) 2024-09-04 22:30:16 +00:00
update.rs fix: use try_insert instead of insert in bevy_ui to prevent panics when despawning ui nodes (#13000) 2024-04-19 18:12:08 +00:00