1
0
mirror of https://github.com/mfontanini/presenterm.git synced 2026-09-01 23:33:21 -06:00

fix: progress bar footer shows actual progress now, fixes issue #900

This commit is contained in:
papinto 2026-07-01 17:18:02 +02:00
parent 5f8add11a2
commit 5e06af4da1
No known key found for this signature in database

View File

@ -116,7 +116,7 @@ impl AsRenderOperations for FooterGenerator {
ProgressBar { character, style } => {
let character = character.to_string();
let total_columns = dimensions.columns as usize / character.width();
let progress_ratio = (self.current_slide + 1) as f64 / self.total_slides as f64;
let progress_ratio = (self.current_slide - 1) as f64 / (self.total_slides - 1) as f64;
let columns_ratio = (total_columns as f64 * progress_ratio).ceil();
let bar = character.repeat(columns_ratio as usize);
let bar = Text::new(bar, *style);