brush-cost: prevent percentage values from overflowing
This commit is contained in:
parent
913d65b0a8
commit
10d384f3d7
1 changed files with 1 additions and 1 deletions
|
@ -17,7 +17,7 @@ class Gauge extends HTMLElement {
|
|||
setValue(value, valueMax) {
|
||||
let clampedNormalized = Math.max(0, Math.min(1, value / valueMax));
|
||||
this.style.setProperty("--progress", `${clampedNormalized * 100}%`);
|
||||
this.title = `${this.label}: ${value} / ${valueMax} (${Math.ceil((value / valueMax) * 100)}%)`;
|
||||
this.title = `${this.label}: ${value} / ${valueMax} (${Math.ceil(clampedNormalized * 100)}%)`;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue