mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-07-28 03:26:28 +00:00
config: add remaining font modifiers
This commit is contained in:
@@ -26,6 +26,18 @@ pub fn apply(self: *Metrics, mods: ModifierSet) void {
|
||||
var it = mods.iterator();
|
||||
while (it.next()) |entry| {
|
||||
switch (entry.key_ptr.*) {
|
||||
// We clamp these values to a minimum of 1 to prevent divide-by-zero
|
||||
// in downstream operations.
|
||||
inline .cell_width,
|
||||
.cell_height,
|
||||
=> |tag| {
|
||||
const original = @field(self, @tagName(tag));
|
||||
@field(self, @tagName(tag)) = @max(
|
||||
entry.value_ptr.apply(original),
|
||||
1,
|
||||
);
|
||||
},
|
||||
|
||||
inline else => |tag| {
|
||||
@field(self, @tagName(tag)) = entry.value_ptr.apply(@field(self, @tagName(tag)));
|
||||
},
|
||||
|
||||
@@ -171,8 +171,9 @@ const Draw = struct {
|
||||
// wave. This constant is arbitrary, change it for aesthetics.
|
||||
const pos = pos: {
|
||||
const MIN_HEIGHT = 7;
|
||||
const height = y_max - self.pos;
|
||||
break :pos if (height < MIN_HEIGHT) self.pos -| MIN_HEIGHT else self.pos;
|
||||
const clamped_pos = @min(y_max, self.pos);
|
||||
const height = y_max - clamped_pos;
|
||||
break :pos if (height < MIN_HEIGHT) clamped_pos -| MIN_HEIGHT else clamped_pos;
|
||||
};
|
||||
|
||||
// The full heightof the wave can be from the bottom to the
|
||||
|
||||
Reference in New Issue
Block a user