Introduce viewport to Widget::draw
This should eventually allow us to only generate primitives that are visible.
This commit is contained in:
parent
8a3ce90959
commit
d328b07b39
31 changed files with 123 additions and 35 deletions
|
|
@ -24,6 +24,7 @@ where
|
|||
defaults: &Defaults,
|
||||
bounds: Rectangle,
|
||||
cursor_position: Point,
|
||||
viewport: &Rectangle,
|
||||
style_sheet: &Self::Style,
|
||||
content: &Element<'_, Message, Self>,
|
||||
content_layout: Layout<'_>,
|
||||
|
|
@ -36,8 +37,13 @@ where
|
|||
},
|
||||
};
|
||||
|
||||
let (content, mouse_interaction) =
|
||||
content.draw(self, &defaults, content_layout, cursor_position);
|
||||
let (content, mouse_interaction) = content.draw(
|
||||
self,
|
||||
&defaults,
|
||||
content_layout,
|
||||
cursor_position,
|
||||
viewport,
|
||||
);
|
||||
|
||||
if let Some(background) = background(bounds, &style) {
|
||||
(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue