From 59c2500c55430ac715b846017f79ad93a58fc3a5 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Date: Mon, 3 May 2021 15:42:02 +0700 Subject: Fix `Scrollable` scrollbar being rendered behind contents ... by issuing a new clip layer just for the scrollbar itself. --- graphics/src/widget/scrollable.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'graphics/src/widget/scrollable.rs') diff --git a/graphics/src/widget/scrollable.rs b/graphics/src/widget/scrollable.rs index 57065ba2..2220e4b8 100644 --- a/graphics/src/widget/scrollable.rs +++ b/graphics/src/widget/scrollable.rs @@ -134,8 +134,16 @@ where Primitive::None }; + let scroll = Primitive::Clip { + bounds, + offset: Vector::new(0, 0), + content: Box::new(Primitive::Group { + primitives: vec![scrollbar, scroller], + }), + }; + Primitive::Group { - primitives: vec![clip, scrollbar, scroller], + primitives: vec![clip, scroll], } } else { content -- cgit