diff --git a/crates/popcorn/src/show_popup.rs b/crates/popcorn/src/show_popup.rs index 386aaf8..49b582d 100644 --- a/crates/popcorn/src/show_popup.rs +++ b/crates/popcorn/src/show_popup.rs @@ -58,7 +58,8 @@ fn set_ui_props( ui.set_value_font_size(cfg.percent_value.font_size as i32); ui.set_value_font_color(parse_hex_color(&cfg.percent_value.font_color)?); ui.set_value_font(SharedString::from(cfg.percent_value.font.as_str())); - ui.set_percent_value(i32::from(args.value.unwrap_or(0))); + let percent_value = i32::from(args.value.unwrap_or(0)).clamp(0, 100); + ui.set_percent_value(percent_value); // Icon styling ui.set_icon_size(cfg.icon.size as i32);