From 6602c1517cbffbc9ff0b6052ce7288cd51eb1e67 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 29 Oct 2019 03:29:29 +0100 Subject: Complete `Scrollable::hash_layout` --- native/src/widget/scrollable.rs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'native/src/widget') diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index f9d75863..9acba3c2 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -5,6 +5,8 @@ use crate::{ pub use iced_core::scrollable::State; +use std::hash::Hash; + /// A scrollable [`Column`]. /// /// [`Column`]: ../column/struct.Column.html @@ -69,15 +71,15 @@ where + self.state.offset(bounds, content_bounds) as f32, ) } else { + // TODO: Make `cursor_position` an `Option` so we can encode + // cursor unavailability. + // This will probably happen naturally once we add multi-window + // support. Point::new(cursor_position.x, -1.0) }; - self.content.on_event( - event, - layout.children().next().unwrap(), - cursor_position, - messages, - ) + self.content + .on_event(event, content, cursor_position, messages) } fn draw( @@ -99,6 +101,12 @@ where } fn hash_layout(&self, state: &mut Hasher) { + std::any::TypeId::of::>().hash(state); + + self.height.hash(state); + self.max_height.hash(state); + self.align_self.hash(state); + self.content.hash_layout(state) } } -- cgit