Commit 17f13b4
committed
DisplayProgressBar: honour min_value when computing fill width
Reported as #954.
DisplayProgressBar computes the filled extent from the raw value
rather than the value's offset from min_value:
bar_filled_width = (value / (max_value - min_value) * width) - 1
When min_value is 0 (default) this happens to be correct, which is
why the bug has not surfaced. For any bar with a non-zero minimum
(e.g. a temperature bar with min=25, max=95) the fill is wrong:
value=25 renders at 36% instead of 0%, value=95 overshoots the bar.
DisplayRadialProgressBar already uses the offset-from-min formula a
couple of hundred lines down, so the two bar primitives are now
consistent.
Fixes #954
Signed-off-by: Sai Asish Y <say.apm35@gmail.com>1 parent 396bdb6 commit 17f13b4
1 file changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
361 | 365 | | |
362 | | - | |
| 366 | + | |
363 | 367 | | |
364 | 368 | | |
365 | 369 | | |
366 | | - | |
| 370 | + | |
367 | 371 | | |
368 | 372 | | |
369 | 373 | | |
| |||
0 commit comments