Remove hash_layout method from Widget trait
This commit is contained in:
parent
9fe5080153
commit
1313c94e3b
35 changed files with 105 additions and 636 deletions
|
|
@ -7,12 +7,11 @@ use iced_native::mouse;
|
|||
use iced_native::overlay;
|
||||
use iced_native::renderer;
|
||||
use iced_native::{
|
||||
Clipboard, Element, Hasher, Length, Point, Rectangle, Shell, Size, Widget,
|
||||
Clipboard, Element, Length, Point, Rectangle, Shell, Size, Widget,
|
||||
};
|
||||
|
||||
use ouroboros::self_referencing;
|
||||
use std::cell::RefCell;
|
||||
use std::hash::Hash;
|
||||
use std::marker::PhantomData;
|
||||
|
||||
/// A reusable, custom widget that uses The Elm Architecture.
|
||||
|
|
@ -217,12 +216,6 @@ where
|
|||
});
|
||||
}
|
||||
|
||||
fn hash_layout(&self, state: &mut Hasher) {
|
||||
self.with_element(|element| {
|
||||
element.hash_layout(state);
|
||||
});
|
||||
}
|
||||
|
||||
fn mouse_interaction(
|
||||
&self,
|
||||
layout: Layout<'_>,
|
||||
|
|
@ -371,18 +364,6 @@ where
|
|||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
fn hash_layout(&self, state: &mut Hasher, position: Point) {
|
||||
struct Marker;
|
||||
std::any::TypeId::of::<Marker>().hash(state);
|
||||
|
||||
(position.x as u32).hash(state);
|
||||
(position.y as u32).hash(state);
|
||||
|
||||
self.with_overlay_maybe(|overlay| {
|
||||
overlay.hash_layout(state);
|
||||
});
|
||||
}
|
||||
|
||||
fn on_event(
|
||||
&mut self,
|
||||
event: iced_native::Event,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue