UI: allow border radius to be optional for images and background (#12592)
# Objective - #12500 broke images and background colors in UI. Try examples `overflow`, `ui_scaling` or `ui_texture_atlas` ## Solution - Makes the component `BorderRadius` optional in the query, as it's not always present. Use `[0.; 4]` as border radius in the extracted node when none was found
This commit is contained in:
parent
f38895a414
commit
779e4c4901
@ -193,7 +193,7 @@ pub fn extract_uinode_background_colors(
|
|||||||
Option<&CalculatedClip>,
|
Option<&CalculatedClip>,
|
||||||
Option<&TargetCamera>,
|
Option<&TargetCamera>,
|
||||||
&BackgroundColor,
|
&BackgroundColor,
|
||||||
&BorderRadius,
|
Option<&BorderRadius>,
|
||||||
)>,
|
)>,
|
||||||
>,
|
>,
|
||||||
) {
|
) {
|
||||||
@ -224,8 +224,11 @@ pub fn extract_uinode_background_colors(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
let border_radius =
|
let border_radius = if let Some(border_radius) = border_radius {
|
||||||
resolve_border_radius(border_radius, uinode.size(), viewport_size, ui_scale.0);
|
resolve_border_radius(border_radius, uinode.size(), viewport_size, ui_scale.0)
|
||||||
|
} else {
|
||||||
|
[0.; 4]
|
||||||
|
};
|
||||||
|
|
||||||
extracted_uinodes.uinodes.insert(
|
extracted_uinodes.uinodes.insert(
|
||||||
entity,
|
entity,
|
||||||
@ -268,7 +271,7 @@ pub fn extract_uinode_images(
|
|||||||
&UiImage,
|
&UiImage,
|
||||||
Option<&TextureAtlas>,
|
Option<&TextureAtlas>,
|
||||||
Option<&ComputedTextureSlices>,
|
Option<&ComputedTextureSlices>,
|
||||||
&BorderRadius,
|
Option<&BorderRadius>,
|
||||||
)>,
|
)>,
|
||||||
>,
|
>,
|
||||||
) {
|
) {
|
||||||
@ -323,8 +326,11 @@ pub fn extract_uinode_images(
|
|||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
let border_radius =
|
let border_radius = if let Some(border_radius) = border_radius {
|
||||||
resolve_border_radius(border_radius, uinode.size(), viewport_size, ui_scale.0);
|
resolve_border_radius(border_radius, uinode.size(), viewport_size, ui_scale.0)
|
||||||
|
} else {
|
||||||
|
[0.; 4]
|
||||||
|
};
|
||||||
|
|
||||||
extracted_uinodes.uinodes.insert(
|
extracted_uinodes.uinodes.insert(
|
||||||
commands.spawn_empty().id(),
|
commands.spawn_empty().id(),
|
||||||
|
Loading…
Reference in New Issue
Block a user