Fix mouse_interaction implementation for float

This commit is contained in:
Héctor Ramón Jiménez 2025-05-02 22:41:22 +02:00
parent 89ba5f9ed8
commit 87afd5b79d
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -365,17 +365,27 @@ where
fn mouse_interaction(
&self,
_layout: Layout<'_>,
layout: Layout<'_>,
cursor: mouse::Cursor,
renderer: &Renderer,
) -> mouse::Interaction {
self.float.content.as_widget().mouse_interaction(
if !cursor.is_over(layout.bounds()) {
return mouse::Interaction::None;
}
let interaction = self.float.content.as_widget().mouse_interaction(
self.state,
self.layout,
cursor * self.transformation.inverse(),
&self.viewport,
renderer,
)
);
if self.float.opaque && interaction == mouse::Interaction::None {
return mouse::Interaction::Idle;
}
interaction
}
fn index(&self) -> f32 {