From 933030efd45016e5a357ff6a271d38ee423e9395 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Thu, 10 Feb 2022 23:42:33 +0300 Subject: Fix terminal not being damage when only font size changed If font size changes however the cells stay the same the terminal won't be damaged, since it wasn't resized, however the visual change happened, thus the entire screen should be damaged. --- alacritty/src/display/mod.rs | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'alacritty/src') diff --git a/alacritty/src/display/mod.rs b/alacritty/src/display/mod.rs index d4d1a91b..7a694278 100644 --- a/alacritty/src/display/mod.rs +++ b/alacritty/src/display/mod.rs @@ -490,6 +490,21 @@ impl Display { info!("Padding: {} x {}", self.size_info.padding_x(), self.size_info.padding_y()); info!("Width: {}, Height: {}", self.size_info.width(), self.size_info.height()); + + // Damage the entire screen after processing update. + self.fully_damage(); + } + + /// Damage the entire window. + fn fully_damage(&mut self) { + let screen_rect = DamageRect { + x: 0, + y: 0, + width: self.size_info.width() as u32, + height: self.size_info.height() as u32, + }; + + self.damage_rects.push(screen_rect); } fn update_damage( @@ -506,15 +521,10 @@ impl Display { } self.damage_highlighted_hints(terminal); - let size_info: SizeInfo = self.size_info.into(); match terminal.damage(selection_range) { - TermDamage::Full => { - let screen_rect = - DamageRect { x: 0, y: 0, width: size_info.width(), height: size_info.height() }; - self.damage_rects.push(screen_rect); - }, + TermDamage::Full => self.fully_damage(), TermDamage::Partial(damaged_lines) => { - let damaged_rects = RenderDamageIterator::new(damaged_lines, size_info); + let damaged_rects = RenderDamageIterator::new(damaged_lines, self.size_info.into()); for damaged_rect in damaged_rects { self.damage_rects.push(damaged_rect); } -- cgit