Fix circular-progress showing 0 when value is 100 and clockwise is false (fixes #543)
This commit is contained in:
parent
956f96fd76
commit
44a8331417
1 changed files with 5 additions and 2 deletions
|
@ -180,8 +180,11 @@ impl WidgetImpl for CircProgPriv {
|
|||
// Padding is not supported yet
|
||||
let fg_color: gdk::RGBA = styles.color(gtk::StateFlags::NORMAL);
|
||||
let bg_color: gdk::RGBA = styles.style_property_for_state("background-color", gtk::StateFlags::NORMAL).get()?;
|
||||
let (start_angle, end_angle) =
|
||||
if clockwise { (0.0, perc_to_rad(value as f64)) } else { (perc_to_rad(100.0 - value as f64), 0.0) };
|
||||
let (start_angle, end_angle) = if clockwise {
|
||||
(0.0, perc_to_rad(value as f64))
|
||||
} else {
|
||||
(perc_to_rad(100.0 - value as f64), 2f64 * std::f64::consts::PI)
|
||||
};
|
||||
|
||||
let total_width = widget.allocated_width() as f64;
|
||||
let total_height = widget.allocated_height() as f64;
|
||||
|
|
Loading…
Add table
Reference in a new issue