Clip outlines using the local clipping rect. (#17385)
# Objective UI node Outlines are clipped using their parent's clipping rect instead of their own. ## Solution Clip outlines using the UI node's own clipping rect.
This commit is contained in:
parent
6ea1574cc1
commit
daf665cc74
@ -9,8 +9,8 @@ mod debug_overlay;
|
||||
|
||||
use crate::widget::ImageNode;
|
||||
use crate::{
|
||||
experimental::UiChildren, BackgroundColor, BorderColor, BoxShadowSamples, CalculatedClip,
|
||||
ComputedNode, DefaultUiCamera, Outline, ResolvedBorderRadius, TargetCamera, UiAntiAlias,
|
||||
BackgroundColor, BorderColor, BoxShadowSamples, CalculatedClip, ComputedNode, DefaultUiCamera,
|
||||
Outline, ResolvedBorderRadius, TargetCamera, UiAntiAlias,
|
||||
};
|
||||
use bevy_app::prelude::*;
|
||||
use bevy_asset::{load_internal_asset, AssetEvent, AssetId, Assets, Handle};
|
||||
@ -443,9 +443,7 @@ pub fn extract_uinode_borders(
|
||||
AnyOf<(&BorderColor, &Outline)>,
|
||||
)>,
|
||||
>,
|
||||
parent_clip_query: Extract<Query<&CalculatedClip>>,
|
||||
mapping: Extract<Query<RenderEntity>>,
|
||||
ui_children: UiChildren,
|
||||
) {
|
||||
let image = AssetId::<Image>::default();
|
||||
let default_camera_entity = default_ui_camera.get();
|
||||
@ -514,10 +512,6 @@ pub fn extract_uinode_borders(
|
||||
if let Some(outline) = maybe_outline.filter(|outline| !outline.color.is_fully_transparent())
|
||||
{
|
||||
let outline_size = computed_node.outlined_node_size();
|
||||
let parent_clip = ui_children
|
||||
.get_parent(entity)
|
||||
.and_then(|parent| parent_clip_query.get(parent).ok());
|
||||
|
||||
extracted_uinodes.uinodes.insert(
|
||||
commands.spawn(TemporaryRenderEntity).id(),
|
||||
ExtractedUiNode {
|
||||
@ -528,7 +522,7 @@ pub fn extract_uinode_borders(
|
||||
..Default::default()
|
||||
},
|
||||
image,
|
||||
clip: parent_clip.map(|clip| clip.clip),
|
||||
clip: maybe_clip.map(|clip| clip.clip),
|
||||
extracted_camera_entity,
|
||||
item: ExtractedUiItem::Node {
|
||||
transform: global_transform.compute_matrix(),
|
||||
|
Loading…
Reference in New Issue
Block a user