1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 15:04:36 +03:00

fix subtraction overflow when creating a new window when tab bar enabled

This commit is contained in:
Wez Furlong 2019-11-22 04:51:55 +00:00
parent e9ec35713c
commit 1737ca4d80

View File

@ -888,13 +888,16 @@ impl TermWindow {
// Fill any marginal area below the last row
let (num_rows, _num_cols) = term.physical_dimensions();
let pixel_height_of_cells =
(num_rows + first_line_offset) * self.render_metrics.cell_size.height as usize;
(num_rows - first_line_offset) * self.render_metrics.cell_size.height as usize;
ctx.clear_rect(
Rect::new(
Point::new(0, pixel_height_of_cells as isize),
Size::new(
self.dimensions.pixel_width as isize,
(self.dimensions.pixel_height - pixel_height_of_cells) as isize,
(self
.dimensions
.pixel_height
.saturating_sub(pixel_height_of_cells)) as isize,
),
),
rgbcolor_to_window_color(palette.background),