Introduce viewport to Widget::draw

This should eventually allow us to only generate primitives that are
visible.
This commit is contained in:
Héctor Ramón Jiménez 2020-08-18 03:37:32 +02:00
parent 8a3ce90959
commit d328b07b39
31 changed files with 123 additions and 35 deletions

View file

@ -1,5 +1,6 @@
//! Display images in your user interface.
use crate::{layout, Element, Hasher, Layout, Length, Point, Size, Widget};
use crate::layout;
use crate::{Element, Hasher, Layout, Length, Point, Rectangle, Size, Widget};
use std::{
hash::{Hash, Hasher as _},
@ -97,6 +98,7 @@ where
_defaults: &Renderer::Defaults,
layout: Layout<'_>,
_cursor_position: Point,
_viewport: &Rectangle,
) -> Renderer::Output {
renderer.draw(self.handle.clone(), layout)
}