Robustify checks for visibility
This commit is contained in:
@@ -642,10 +642,6 @@ impl Element for Div {
|
|||||||
&mut element_state.interactive_state,
|
&mut element_state.interactive_state,
|
||||||
cx,
|
cx,
|
||||||
|style, scroll_offset, cx| {
|
|style, scroll_offset, cx| {
|
||||||
if style.visibility == Visibility::Hidden {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let z_index = style.z_index.unwrap_or(0);
|
let z_index = style.z_index.unwrap_or(0);
|
||||||
|
|
||||||
cx.with_z_index(z_index, |cx| {
|
cx.with_z_index(z_index, |cx| {
|
||||||
@@ -779,6 +775,10 @@ impl Interactivity {
|
|||||||
) {
|
) {
|
||||||
let style = self.compute_style(Some(bounds), element_state, cx);
|
let style = self.compute_style(Some(bounds), element_state, cx);
|
||||||
|
|
||||||
|
if style.visibility == Visibility::Hidden {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
if self.element_id.is_some()
|
if self.element_id.is_some()
|
||||||
&& (style.debug || style.debug_below || cx.has_global::<crate::DebugBelow>())
|
&& (style.debug || style.debug_below || cx.has_global::<crate::DebugBelow>())
|
||||||
@@ -890,11 +890,10 @@ impl Interactivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if style.visibility == Visibility::Visible
|
if style
|
||||||
&& style
|
.background
|
||||||
.background
|
.as_ref()
|
||||||
.as_ref()
|
.is_some_and(|fill| fill.color().is_some_and(|color| !color.is_transparent()))
|
||||||
.is_some_and(|fill| fill.color().is_some())
|
|
||||||
{
|
{
|
||||||
cx.with_z_index(style.z_index.unwrap_or(0), |cx| cx.add_opaque_layer(bounds))
|
cx.with_z_index(style.z_index.unwrap_or(0), |cx| cx.add_opaque_layer(bounds))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user