Fix drawing empty Quad on empty ProgressBar

This commit is contained in:
Héctor Ramón Jiménez 2020-01-08 03:32:38 +01:00
parent cae4463e83
commit 89b1ac6eac

View file

@ -29,6 +29,8 @@ impl progress_bar::Renderer for Renderer {
}], }],
}; };
(
if active_progress_width > 0.0 {
let bar = Primitive::Quad { let bar = Primitive::Quad {
bounds: Rectangle { bounds: Rectangle {
width: active_progress_width, width: active_progress_width,
@ -40,9 +42,11 @@ impl progress_bar::Renderer for Renderer {
border_color: Color::TRANSPARENT, border_color: Color::TRANSPARENT,
}; };
(
Primitive::Group { Primitive::Group {
primitives: vec![background, bar], primitives: vec![background, bar],
}
} else {
background
}, },
MouseCursor::OutOfBounds, MouseCursor::OutOfBounds,
) )