From d328b07b3937c968fc8139f0b5c61903ebb893e7 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 18 Aug 2020 03:37:32 +0200 Subject: Introduce `viewport` to `Widget::draw` This should eventually allow us to only generate primitives that are visible. --- native/src/widget/container.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'native/src/widget/container.rs') diff --git a/native/src/widget/container.rs b/native/src/widget/container.rs index b8316e62..5b04d699 100644 --- a/native/src/widget/container.rs +++ b/native/src/widget/container.rs @@ -191,11 +191,13 @@ where defaults: &Renderer::Defaults, layout: Layout<'_>, cursor_position: Point, + viewport: &Rectangle, ) -> Renderer::Output { renderer.draw( defaults, layout.bounds(), cursor_position, + viewport, &self.style, &self.content, layout.children().next().unwrap(), @@ -242,6 +244,7 @@ pub trait Renderer: crate::Renderer { defaults: &Self::Defaults, bounds: Rectangle, cursor_position: Point, + viewport: &Rectangle, style: &Self::Style, content: &Element<'_, Message, Self>, content_layout: Layout<'_>, -- cgit