mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-11 13:51:01 -05:00
Fix padding update not updating renderer
This fixes an issue where it was possible to update the padding of the terminal without actually queueing an update for the renderer projection, leading to a blurry projection. Closes #6502.
This commit is contained in:
parent
d92a8a0e16
commit
19120f40be
2 changed files with 13 additions and 9 deletions
|
@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
- Crash with `OT-SVG` fonts on Linux/BSD
|
||||
- Crash during text compose on old GNOME under Wayland
|
||||
- Mouse cursor staying hidden after window regains focus on macOS Ventura
|
||||
- Blurry fonts when changing padding size at runtime
|
||||
|
||||
## 0.11.0
|
||||
|
||||
|
|
|
@ -620,14 +620,11 @@ impl Display {
|
|||
if let Some(dimensions) = pending_update.dimensions() {
|
||||
width = dimensions.width as f32;
|
||||
height = dimensions.height as f32;
|
||||
|
||||
let renderer_update = self.pending_renderer_update.get_or_insert(Default::default());
|
||||
renderer_update.resize = true
|
||||
}
|
||||
|
||||
let padding = config.window.padding(self.window.scale_factor as f32);
|
||||
|
||||
self.size_info = SizeInfo::new(
|
||||
let mut new_size = SizeInfo::new(
|
||||
width,
|
||||
height,
|
||||
cell_width,
|
||||
|
@ -638,16 +635,22 @@ impl Display {
|
|||
);
|
||||
|
||||
// Update number of column/lines in the viewport.
|
||||
let message_bar_lines =
|
||||
message_buffer.message().map_or(0, |m| m.text(&self.size_info).len());
|
||||
let message_bar_lines = message_buffer.message().map_or(0, |m| m.text(&new_size).len());
|
||||
let search_lines = usize::from(search_active);
|
||||
self.size_info.reserve_lines(message_bar_lines + search_lines);
|
||||
new_size.reserve_lines(message_bar_lines + search_lines);
|
||||
|
||||
// Resize PTY.
|
||||
pty_resize_handle.on_resize(self.size_info.into());
|
||||
pty_resize_handle.on_resize(new_size.into());
|
||||
|
||||
// Resize terminal.
|
||||
terminal.resize(self.size_info);
|
||||
terminal.resize(new_size);
|
||||
|
||||
// Queue renderer update if terminal dimensions/padding changed.
|
||||
if new_size != self.size_info {
|
||||
let renderer_update = self.pending_renderer_update.get_or_insert(Default::default());
|
||||
renderer_update.resize = true;
|
||||
}
|
||||
self.size_info = new_size;
|
||||
}
|
||||
|
||||
/// Update the state of the renderer.
|
||||
|
|
Loading…
Reference in a new issue