summaryrefslogtreecommitdiffstats
path: root/native/src/widget/container.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-08-18 03:37:32 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-10-28 06:21:07 +0100
commitd328b07b3937c968fc8139f0b5c61903ebb893e7 (patch)
tree940ae9e93006ad4fdae2d86a2f70833ee99e0b10 /native/src/widget/container.rs
parent8a3ce90959e281cd73a7486d800df8d65478a698 (diff)
downloadiced-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/container.rs')
-rw-r--r--native/src/widget/container.rs3
1 files changed, 3 insertions, 0 deletions
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<'_>,