Take Rectangle by value in Cursor API

This commit is contained in:
Héctor Ramón Jiménez 2023-06-08 20:16:46 +02:00
parent 34451bff18
commit 5c8cfb411e
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
21 changed files with 57 additions and 62 deletions

View file

@ -311,7 +311,7 @@ pub fn update<'a, Message: Clone>(
if on_press.is_some() {
let bounds = layout.bounds();
if cursor.is_over(&bounds) {
if cursor.is_over(bounds) {
let state = state();
state.is_pressed = true;
@ -330,7 +330,7 @@ pub fn update<'a, Message: Clone>(
let bounds = layout.bounds();
if cursor.is_over(&bounds) {
if cursor.is_over(bounds) {
shell.publish(on_press);
}
@ -364,7 +364,7 @@ pub fn draw<'a, Renderer: crate::core::Renderer>(
where
Renderer::Theme: StyleSheet,
{
let is_mouse_over = cursor.is_over(&bounds);
let is_mouse_over = cursor.is_over(bounds);
let styling = if !is_enabled {
style_sheet.disabled(style)
@ -440,7 +440,7 @@ pub fn mouse_interaction(
cursor: mouse::Cursor,
is_enabled: bool,
) -> mouse::Interaction {
let is_mouse_over = cursor.is_over(&layout.bounds());
let is_mouse_over = cursor.is_over(layout.bounds());
if is_mouse_over && is_enabled {
mouse::Interaction::Pointer