Skip to content

Commit 4fb2039

Browse files
committed
Fixed bug in the HUD displaying numbers below 1%
1 parent e18d9d9 commit 4fb2039

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

User interface/HUD/TahoeVolumeHUD.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN
2929
@property (class, readonly, strong) TahoeVolumeHUD *sharedManager;
3030
@property (weak, nonatomic, nullable) id<TahoeVolumeHUDDelegate> delegate;
3131

32-
/// Show/update the HUD under a status bar button. `volume` is 0.0–1.0 (or 0–100; both accepted).
32+
/// Show/update the HUD under a status bar button. `volume` is in the 0–100 range.
3333
- (void)showHUDWithVolume:(double)volume usingMusicPlayer:(PlayerApplication*)controlledPlayer andLabel:(NSString*)label anchoredToStatusButton:(NSStatusBarButton *)button;
3434

3535
/// Programmatically hide it immediately.

User interface/HUD/TahoeVolumeHUD.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ - (instancetype)initPrivate {
151151

152152
- (void)showHUDWithVolume:(double)volume usingMusicPlayer:(PlayerApplication*)player andLabel:(NSString*)label anchoredToStatusButton:(NSStatusBarButton *)button {
153153
self.controlledPlayer = player;
154-
155-
if (volume > 1.0) volume = MAX(0.0, MIN(1.0, volume / 100.0));
154+
155+
volume = MAX(0.0, MIN(1.0, volume / 100.0));
156156
self.slider.doubleValue = volume;
157157

158158
// Update header
@@ -192,7 +192,7 @@ - (void)showHUDWithVolume:(double)volume usingMusicPlayer:(PlayerApplication*)pl
192192

193193

194194
- (void)setVolume:(double)volume {
195-
if (volume > 1.0) volume = MAX(0.0, MIN(1.0, volume / 100.0));
195+
volume = MAX(0.0, MIN(1.0, volume / 100.0));
196196
self.slider.doubleValue = volume;
197197
}
198198

0 commit comments

Comments
 (0)