diff options
author | 2020-08-18 03:37:32 +0200 | |
---|---|---|
committer | 2020-10-28 06:21:07 +0100 | |
commit | d328b07b3937c968fc8139f0b5c61903ebb893e7 (patch) | |
tree | 940ae9e93006ad4fdae2d86a2f70833ee99e0b10 /native/src/widget/column.rs | |
parent | 8a3ce90959e281cd73a7486d800df8d65478a698 (diff) | |
download | iced-d328b07b3937c968fc8139f0b5c61903ebb893e7.tar.gz iced-d328b07b3937c968fc8139f0b5c61903ebb893e7.tar.bz2 iced-d328b07b3937c968fc8139f0b5c61903ebb893e7.zip |
Introduce `viewport` to `Widget::draw`
This should eventually allow us to only generate primitives that are
visible.
Diffstat (limited to 'native/src/widget/column.rs')
-rw-r--r-- | native/src/widget/column.rs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/native/src/widget/column.rs b/native/src/widget/column.rs index a5ac2101..e874ad42 100644 --- a/native/src/widget/column.rs +++ b/native/src/widget/column.rs @@ -1,9 +1,11 @@ //! Distribute content vertically. use std::hash::Hash; +use crate::layout; +use crate::overlay; use crate::{ - layout, overlay, Align, Clipboard, Element, Event, Hasher, Layout, Length, - Point, Widget, + Align, Clipboard, Element, Event, Hasher, Layout, Length, Point, Rectangle, + Widget, }; use std::u32; @@ -181,8 +183,15 @@ where defaults: &Renderer::Defaults, layout: Layout<'_>, cursor_position: Point, + viewport: &Rectangle, ) -> Renderer::Output { - renderer.draw(defaults, &self.children, layout, cursor_position) + renderer.draw( + defaults, + &self.children, + layout, + cursor_position, + viewport, + ) } fn hash_layout(&self, state: &mut Hasher) { @@ -237,6 +246,7 @@ pub trait Renderer: crate::Renderer + Sized { content: &[Element<'_, Message, Self>], layout: Layout<'_>, cursor_position: Point, + viewport: &Rectangle, ) -> Self::Output; } |