Fix hovering over elements nested inside their parents

Co-Authored-By: Conrad Irwin <conrad@zed.dev>
This commit is contained in:
Julia 2024-01-23 16:25:10 -05:00 committed by Julia
parent d60ef81ede
commit 849a1324f7
2 changed files with 16 additions and 20 deletions

View file

@ -2496,8 +2496,6 @@ impl CollabPanel {
.absolute()
.right(rems(0.))
.h_full()
// HACK: Without this the channel name clips on top of the icons, but I'm not sure why.
.z_index(10)
.child(
h_flex()
.h_full()

View file

@ -859,15 +859,14 @@ impl<'a> WindowContext<'a> {
// At this point, we've established that this opaque layer is on top of the queried layer
// and contains the position:
// - If the opaque layer is an extension of the queried layer, we don't want
// to consider the opaque layer to be on top and so we ignore it.
// - Else, we will bail early and say that the queried layer wasn't the top one.
let opaque_layer_is_extension_of_queried_layer = opaque_layer.len() >= layer.len()
&& opaque_layer
.iter()
.zip(layer.iter())
.all(|(a, b)| a.z_index == b.z_index);
if !opaque_layer_is_extension_of_queried_layer {
// If neither the opaque layer or the queried layer is an extension of the other then
// we know they are on different stacking orders, and return false.
let is_on_same_layer = opaque_layer
.iter()
.zip(layer.iter())
.all(|(a, b)| a.z_index == b.z_index);
if !is_on_same_layer {
return false;
}
}
@ -908,15 +907,14 @@ impl<'a> WindowContext<'a> {
// At this point, we've established that this opaque layer is on top of the queried layer
// and contains the position:
// - If the opaque layer is an extension of the queried layer, we don't want
// to consider the opaque layer to be on top and so we ignore it.
// - Else, we will bail early and say that the queried layer wasn't the top one.
let opaque_layer_is_extension_of_queried_layer = opaque_layer.len() >= layer.len()
&& opaque_layer
.iter()
.zip(layer.iter())
.all(|(a, b)| a.z_index == b.z_index);
if !opaque_layer_is_extension_of_queried_layer {
// If neither the opaque layer or the queried layer is an extension of the other then
// we know they are on different stacking orders, and return false.
let is_on_same_layer = opaque_layer
.iter()
.zip(layer.iter())
.all(|(a, b)| a.z_index == b.z_index);
if !is_on_same_layer {
return false;
}
}