fix(Metal): force a full rebuild in `setFontGrid` (#6008)

This was causing garbled text due to a non-rebuilt rows referencing an
outdated atlas when the DPI changed but not the grid dimensions, which
could be caused by a variety of things such as the quick terminal
slide-in, dpi scaling changes on sleep/wake, moving windows between
displays because of closing/opening the laptop lid, etc.

Fixes #2731
pull/6034/head
Qwerasd 2025-02-27 09:43:47 -05:00 committed by GitHub
commit a1437e5579
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -1019,6 +1019,10 @@ pub fn setFontGrid(self: *Metal, grid: *font.SharedGrid) void {
// out a better way to handle this.
log.err("error resizing cells buffer err={}", .{err});
};
// Reset our viewport to force a rebuild, since `setScreenSize` only
// does this when the number of cells changes, which isn't guaranteed.
self.cells_viewport = null;
}
/// Update the frame data.