fix(ags): make volume percent accurate
This commit is contained in:
parent
a73dd316d1
commit
2d9f758dae
1 changed files with 8 additions and 1 deletions
|
@ -34,7 +34,14 @@ const SpeakerPercentLabel = props => Label({
|
||||||
if (!Audio.speaker)
|
if (!Audio.speaker)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
label.label = `${Math.floor(Audio.speaker.volume * 100)}%`;
|
let vol = Math.floor(Audio.speaker.volume * 100);
|
||||||
|
|
||||||
|
if (vol == 0) {
|
||||||
|
label.label = vol + '%';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
label.label = vol + 1 + '%';
|
||||||
|
}
|
||||||
}, 'speaker-changed']],
|
}, 'speaker-changed']],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue