Browse Source

fix progress bars rounding instead of flooring for segmented bars.

master
Gisle Aune 2 years ago
parent
commit
d88352cc24
  1. 11
      frontend/src/lib/components/common/Progress.svelte

11
frontend/src/lib/components/common/Progress.svelte

@ -69,8 +69,15 @@
nonSegmented = alwaysSmooth || (target >= 60);
if (!nonSegmented) {
ons = Math.round(ons);
offs = Math.round(offs);
ons = Math.floor(ons);
offs = Math.ceil(offs);
if (ons + offs > target) {
if (offs > 0) {
offs -= 1;
} else {
ons -= 1;
}
}
}
} else {
offClass = "none";

Loading…
Cancel
Save