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

@ -73,7 +73,9 @@ pub use text::Text;
#[doc(no_inline)]
pub use text_input::TextInput;
use crate::{layout, overlay, Clipboard, Event, Hasher, Layout, Length, Point};
use crate::{
layout, overlay, Clipboard, Event, Hasher, Layout, Length, Point, Rectangle,
};
/// A component that displays information and allows interaction.
///
@ -137,6 +139,7 @@ where
defaults: &Renderer::Defaults,
layout: Layout<'_>,
cursor_position: Point,
viewport: &Rectangle,
) -> Renderer::Output;
/// Computes the _layout_ hash of the [`Widget`].