From 63cd0fd8eb1eebae8de7d5141c846fc4ea55d702 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 30 Oct 2019 03:31:07 +0100 Subject: Draft `TextInput` widget structure Also started a `todos` example to showcase it! --- wgpu/src/renderer/scrollable.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'wgpu/src/renderer/scrollable.rs') diff --git a/wgpu/src/renderer/scrollable.rs b/wgpu/src/renderer/scrollable.rs index 7bce3a68..e9dfc760 100644 --- a/wgpu/src/renderer/scrollable.rs +++ b/wgpu/src/renderer/scrollable.rs @@ -56,7 +56,7 @@ impl scrollable::Renderer for Renderer { let (content, mouse_cursor) = scrollable.content.draw(self, content, cursor_position); - let primitive = Primitive::Clip { + let clip = Primitive::Clip { bounds, offset, content: Box::new(content), @@ -107,19 +107,15 @@ impl scrollable::Renderer for Renderer { }; Primitive::Group { - primitives: vec![ - primitive, - scrollbar_background, - scrollbar, - ], + primitives: vec![clip, scrollbar_background, scrollbar], } } else { Primitive::Group { - primitives: vec![primitive, scrollbar], + primitives: vec![clip, scrollbar], } } } else { - primitive + clip }, if is_mouse_over_scrollbar || scrollable.state.is_scrollbar_grabbed() -- cgit