summaryrefslogtreecommitdiffstats
path: root/native/src/widget/scrollable.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/scrollable.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/scrollable.rs')
-rw-r--r--native/src/widget/scrollable.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs
index cb181899..60ec2d7d 100644
--- a/native/src/widget/scrollable.rs
+++ b/native/src/widget/scrollable.rs
@@ -303,6 +303,7 @@ where
defaults: &Renderer::Defaults,
layout: Layout<'_>,
cursor_position: Point,
+ _viewport: &Rectangle,
) -> Renderer::Output {
let bounds = layout.bounds();
let content_layout = layout.children().next().unwrap();
@@ -335,6 +336,10 @@ where
defaults,
content_layout,
cursor_position,
+ &Rectangle {
+ y: bounds.y + offset as f32,
+ ..bounds
+ },
)
};