Skip to content

Commit

Permalink
Find layers_below only if Stack is hovered
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Aug 14, 2024
1 parent 9ed7fb8 commit 5d7d74f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions widget/src/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,7 @@ where
viewport: &Rectangle,
) {
if let Some(clipped_viewport) = layout.bounds().intersection(viewport) {
let layers_below = if cursor == mouse::Cursor::Unavailable {
self.children.len()
} else {
let layers_below = if cursor.is_over(layout.bounds()) {
self.children
.iter()
.rev()
Expand All @@ -286,6 +284,8 @@ where
})
.map(|i| self.children.len() - i - 1)
.unwrap_or(self.children.len())
} else {
self.children.len()
};

let mut layers = self
Expand Down

0 comments on commit 5d7d74f

Please sign in to comment.