diff options
author | 2021-10-14 17:15:29 +0700 | |
---|---|---|
committer | 2021-10-14 17:15:29 +0700 | |
commit | dfceee99aad9462f09ca61081e68e1decb2fed92 (patch) | |
tree | 2950742377c22cb231e22477a3aab5156cae4783 /graphics | |
parent | 7c4738735b6cd5eafb544de01dbf5dd5091dc188 (diff) | |
download | iced-dfceee99aad9462f09ca61081e68e1decb2fed92.tar.gz iced-dfceee99aad9462f09ca61081e68e1decb2fed92.tar.bz2 iced-dfceee99aad9462f09ca61081e68e1decb2fed92.zip |
Implement `Widget::draw` for `Scrollable`
Rendering the scroller is still WIP
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/src/renderer.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/graphics/src/renderer.rs b/graphics/src/renderer.rs index a708cb67..91f6b550 100644 --- a/graphics/src/renderer.rs +++ b/graphics/src/renderer.rs @@ -47,7 +47,12 @@ where layout } - 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), + ) { let current_primitives = std::mem::replace(&mut self.primitives, Vec::new()); @@ -58,7 +63,7 @@ where self.primitives.push(Primitive::Clip { bounds, - offset: Vector::new(0, 0), + offset, content: Box::new(Primitive::Group { primitives: layer_primitives, }), @@ -77,6 +82,8 @@ where type Font = Font; fn fill_text(&mut self, text: renderer::text::Section<'_, Self::Font>) { + dbg!(text); + self.primitives.push(Primitive::Text { content: text.content.to_string(), bounds: text.bounds, |