mirror of
https://github.com/wez/wezterm.git
synced 2024-11-23 23:21:08 +03:00
wezterm: blow more caches when scaling changes
The recent addition of dynamic fallback resolution highlighted this issue. The test scenario is: 1. Output some glyphs that need dynamic fallback 2. ctrl-+ to change the font scaling 3. rasterization fails because of some bad cached state; the font_idx's were invalidated by the scale change which reset the dynamically discovered fallback fonts. The resolution is to blow the glyph and shape caches when scaling is changed.
This commit is contained in:
parent
80488ea14d
commit
164adb78e3
@ -766,7 +766,7 @@ impl WindowCallbacks for TermWindow {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
log::error!("paint_opengl_pass failed: {}", err);
|
||||
log::error!("paint_opengl_pass failed: {:#}", err);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2062,6 +2062,8 @@ impl TermWindow {
|
||||
self.fonts
|
||||
.change_scaling(font_scale, dimensions.dpi as f64 / 96.);
|
||||
self.render_metrics = RenderMetrics::new(&self.fonts);
|
||||
self.render_state.opengl().glyph_cache.borrow_mut().clear();
|
||||
self.shape_cache.borrow_mut().clear();
|
||||
|
||||
self.recreate_texture_atlas(None)
|
||||
.expect("failed to recreate atlas");
|
||||
|
Loading…
Reference in New Issue
Block a user