mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-19 05:50:27 +00:00
Use std.math.clamp
Co-authored-by: Leah Amelia Chen <github@acc.pluie.me>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user