From a3c55f75174f9bc87f80d7fe6236a71138d2fd77 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 29 Oct 2019 02:13:22 +0100 Subject: Stop leaking impl details in scrollable `Renderer` --- native/src/widget/scrollable.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'native/src/widget') diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index 95e8c74d..f9d75863 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -1,6 +1,6 @@ use crate::{ - column, input::mouse, Element, Event, Hasher, Layout, Node, Point, Style, - Widget, + column, input::mouse, Element, Event, Hasher, Layout, Node, Point, + Rectangle, Style, Widget, }; pub use iced_core::scrollable::State; @@ -86,7 +86,16 @@ where layout: Layout<'_>, cursor_position: Point, ) -> Renderer::Output { - self::Renderer::draw(renderer, &self, layout, cursor_position) + let bounds = layout.bounds(); + let content_layout = layout.children().next().unwrap(); + + self::Renderer::draw( + renderer, + &self, + bounds, + content_layout, + cursor_position, + ) } fn hash_layout(&self, state: &mut Hasher) { @@ -98,7 +107,8 @@ pub trait Renderer: crate::Renderer + Sized { fn draw( &mut self, scrollable: &Scrollable<'_, Message, Self>, - layout: Layout<'_>, + bounds: Rectangle, + content_layout: Layout<'_>, cursor_position: Point, ) -> Self::Output; } -- cgit