Implement Widget::draw for Scrollable

Rendering the scroller is still WIP
This commit is contained in:
Héctor Ramón Jiménez 2021-10-14 17:15:29 +07:00
parent 7c4738735b
commit dfceee99aa
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
5 changed files with 122 additions and 50 deletions

View file

@ -29,7 +29,7 @@ mod null;
pub use null::Null;
use crate::layout;
use crate::{Element, Rectangle};
use crate::{Element, Rectangle, Vector};
/// A component that can take the state of a user interface and produce an
/// output for its users.
@ -51,7 +51,12 @@ pub trait Renderer: Sized {
element.layout(self, limits)
}
fn with_layer(&mut self, bounds: Rectangle, f: impl FnOnce(&mut Self));
fn with_layer(
&mut self,
bounds: Rectangle,
offset: Vector<u32>,
f: impl FnOnce(&mut Self),
);
fn clear(&mut self);
}