Skip to content

Commit

Permalink
fixup pty pixel size calculation
Browse files Browse the repository at this point in the history
Derive the pixels from the rows/cols rather than the available space.

refs: #535
  • Loading branch information
wez committed Mar 13, 2021
1 parent 868a085 commit 3d64246
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions wezterm-gui/src/termwindow/resize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,12 @@ impl super::TermWindow {
let size = PtySize {
rows: rows as u16,
cols: cols as u16,
pixel_height: avail_height as u16,
pixel_width: avail_width as u16,
// Take care to use the exact pixel dimensions of the cells, rather
// than the available space, so that apps that are sensitive to
// the pixels-per-cell have consistent values at a given font size.
// https://github.com/wez/wezterm/issues/535
pixel_height: rows as u16 * self.render_metrics.cell_size.height as u16,
pixel_width: cols as u16 * self.render_metrics.cell_size.width as u16,
};

(size, *dimensions)
Expand Down

0 comments on commit 3d64246

Please sign in to comment.