Fix hovering over elements nested inside their parents
Co-Authored-By: Conrad Irwin <conrad@zed.dev>
This commit is contained in:
parent
d60ef81ede
commit
849a1324f7
2 changed files with 16 additions and 20 deletions
|
@ -2496,8 +2496,6 @@ impl CollabPanel {
|
||||||
.absolute()
|
.absolute()
|
||||||
.right(rems(0.))
|
.right(rems(0.))
|
||||||
.h_full()
|
.h_full()
|
||||||
// HACK: Without this the channel name clips on top of the icons, but I'm not sure why.
|
|
||||||
.z_index(10)
|
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
.h_full()
|
.h_full()
|
||||||
|
|
|
@ -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
|
// At this point, we've established that this opaque layer is on top of the queried layer
|
||||||
// and contains the position:
|
// and contains the position:
|
||||||
// - If the opaque layer is an extension of the queried layer, we don't want
|
// If neither the opaque layer or the queried layer is an extension of the other then
|
||||||
// to consider the opaque layer to be on top and so we ignore it.
|
// we know they are on different stacking orders, and return false.
|
||||||
// - Else, we will bail early and say that the queried layer wasn't the top one.
|
let is_on_same_layer = opaque_layer
|
||||||
let opaque_layer_is_extension_of_queried_layer = opaque_layer.len() >= layer.len()
|
.iter()
|
||||||
&& opaque_layer
|
.zip(layer.iter())
|
||||||
.iter()
|
.all(|(a, b)| a.z_index == b.z_index);
|
||||||
.zip(layer.iter())
|
|
||||||
.all(|(a, b)| a.z_index == b.z_index);
|
if !is_on_same_layer {
|
||||||
if !opaque_layer_is_extension_of_queried_layer {
|
|
||||||
return false;
|
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
|
// At this point, we've established that this opaque layer is on top of the queried layer
|
||||||
// and contains the position:
|
// and contains the position:
|
||||||
// - If the opaque layer is an extension of the queried layer, we don't want
|
// If neither the opaque layer or the queried layer is an extension of the other then
|
||||||
// to consider the opaque layer to be on top and so we ignore it.
|
// we know they are on different stacking orders, and return false.
|
||||||
// - Else, we will bail early and say that the queried layer wasn't the top one.
|
let is_on_same_layer = opaque_layer
|
||||||
let opaque_layer_is_extension_of_queried_layer = opaque_layer.len() >= layer.len()
|
.iter()
|
||||||
&& opaque_layer
|
.zip(layer.iter())
|
||||||
.iter()
|
.all(|(a, b)| a.z_index == b.z_index);
|
||||||
.zip(layer.iter())
|
|
||||||
.all(|(a, b)| a.z_index == b.z_index);
|
if !is_on_same_layer {
|
||||||
if !opaque_layer_is_extension_of_queried_layer {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue