1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-24 07:46:59 +03:00

gui: ResetFontAndWindowSize should use known dpi

This code was partially replicating the initial window setup
where we didn't necessarily know the dpi, but in the context
where this is run, we do know the dpi for the window, so
let's consistently use that number throughout.

refs: #1039
This commit is contained in:
Wez Furlong 2021-12-11 09:43:32 -07:00
parent a65a4af9a7
commit bf34be3ab8

View File

@ -327,7 +327,7 @@ impl super::TermWindow {
let size = config.initial_size();
let fontconfig = Rc::new(FontConfiguration::new(
Some(config.clone()),
config.dpi.unwrap_or_else(|| ::window::default_dpi()) as usize,
self.dimensions.dpi,
)?);
let render_metrics = RenderMetrics::new(&fontconfig)?;
@ -367,7 +367,7 @@ impl super::TermWindow {
+ padding_top
+ padding_bottom) as usize
+ tab_bar_height,
dpi: config.dpi.unwrap_or_else(|| ::window::default_dpi()) as usize,
dpi: self.dimensions.dpi,
};
self.apply_scale_change(&dimensions, 1.0, window);