diff --git a/examples/progress.rs b/examples/progress.rs index 0b9ff23..3da9245 100644 --- a/examples/progress.rs +++ b/examples/progress.rs @@ -41,8 +41,7 @@ fn main() { })) .title("Progress bar example") - .padding_top(1) - .padding_bottom(1) + .padding((0,0,1,1)) .with_id("dialog")); siv.set_fps(10); diff --git a/src/view/progress_bar.rs b/src/view/progress_bar.rs index 99eabd2..e29ef04 100644 --- a/src/view/progress_bar.rs +++ b/src/view/progress_bar.rs @@ -84,7 +84,7 @@ impl View for ProgressBar { let available = printer.size.x; let value = self.value.load(Ordering::Relaxed); - let length = (available * (value - self.min)) / (self.max - self.min); + let length = ((1 + available) * (value - self.min)) / (1 + self.max - self.min); printer.with_color(ColorStyle::Highlight, |printer| { printer.print_hline((0, 0), length, " "); });