diff options
author | 2023-05-23 04:39:41 +0200 | |
---|---|---|
committer | 2023-05-23 04:39:41 +0200 | |
commit | 29326952b420c22c34a5a1315e8f8a1ce77311ef (patch) | |
tree | 4a3f1fe795d3ce8e3625e1648889fc9b2cb688b4 /widget/src/scrollable.rs | |
parent | 12a57fae5c4a8cf24976c551a64753b5da32ee30 (diff) | |
download | iced-29326952b420c22c34a5a1315e8f8a1ce77311ef.tar.gz iced-29326952b420c22c34a5a1315e8f8a1ce77311ef.tar.bz2 iced-29326952b420c22c34a5a1315e8f8a1ce77311ef.zip |
Avoid drawing empty quads in `widget::scrollable`
Diffstat (limited to 'widget/src/scrollable.rs')
-rw-r--r-- | widget/src/scrollable.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs index c3478493..af5424c0 100644 --- a/widget/src/scrollable.rs +++ b/widget/src/scrollable.rs @@ -809,9 +809,11 @@ pub fn draw<Renderer>( style: Scrollbar, scrollbar: &internals::Scrollbar| { //track - if style.background.is_some() - || (style.border_color != Color::TRANSPARENT - && style.border_width > 0.0) + if scrollbar.bounds.width > 0.0 + && scrollbar.bounds.height > 0.0 + && (style.background.is_some() + || (style.border_color != Color::TRANSPARENT + && style.border_width > 0.0)) { renderer.fill_quad( renderer::Quad { @@ -827,9 +829,11 @@ pub fn draw<Renderer>( } //thumb - if style.scroller.color != Color::TRANSPARENT - || (style.scroller.border_color != Color::TRANSPARENT - && style.scroller.border_width > 0.0) + if scrollbar.scroller.bounds.width > 0.0 + && scrollbar.scroller.bounds.height > 0.0 + && (style.scroller.color != Color::TRANSPARENT + || (style.scroller.border_color != Color::TRANSPARENT + && style.scroller.border_width > 0.0)) { renderer.fill_quad( renderer::Quad { |