Remove hash_layout method from Widget trait

This commit is contained in:
Héctor Ramón Jiménez 2022-02-22 14:10:49 +07:00
parent 9fe5080153
commit 1313c94e3b
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
35 changed files with 105 additions and 636 deletions

View file

@ -11,9 +11,7 @@ mod circle {
// implemented by `iced_wgpu` and other renderers.
use iced_native::layout::{self, Layout};
use iced_native::renderer;
use iced_native::{
Color, Element, Hasher, Length, Point, Rectangle, Size, Widget,
};
use iced_native::{Color, Element, Length, Point, Rectangle, Size, Widget};
pub struct Circle {
radius: f32,
@ -45,12 +43,6 @@ mod circle {
layout::Node::new(Size::new(self.radius * 2.0, self.radius * 2.0))
}
fn hash_layout(&self, state: &mut Hasher) {
use std::hash::Hash;
self.radius.to_bits().hash(state);
}
fn draw(
&self,
renderer: &mut Renderer,

View file

@ -14,8 +14,7 @@ mod rainbow {
use iced_graphics::{Backend, Primitive};
use iced_native::{
layout, Element, Hasher, Layout, Length, Point, Rectangle, Size,
Vector, Widget,
layout, Element, Layout, Length, Point, Rectangle, Size, Vector, Widget,
};
pub struct Rainbow;
@ -48,8 +47,6 @@ mod rainbow {
layout::Node::new(Size::new(size.width, size.width))
}
fn hash_layout(&self, _state: &mut Hasher) {}
fn draw(
&self,
renderer: &mut Renderer<B>,