Use `std.math.clamp`
Co-authored-by: Leah Amelia Chen <github@acc.pluie.me>pull/5326/head
parent
8d0c3c7b7c
commit
0e8b266662
|
|
@ -2413,13 +2413,7 @@ pub fn ringBell(self: *Surface) !void {
|
|||
.required => |path| .{ path, false },
|
||||
};
|
||||
|
||||
const volume: f64 = @min(
|
||||
@max(
|
||||
0.0,
|
||||
self.app.config.@"bell-audio-volume",
|
||||
),
|
||||
1.0,
|
||||
);
|
||||
const volume = std.math.clamp(self.app.config.@"bell-audio-volume", 0.0, 1.0);
|
||||
|
||||
std.debug.assert(std.fs.path.isAbsolute(pathname));
|
||||
const media_file = gtk.MediaFile.newForFilename(pathname);
|
||||
|
|
|
|||
Loading…
Reference in New Issue