mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
renderer: always reset font group on config change
This commit is contained in:
@ -975,13 +975,14 @@ fn prepKittyGraphics(
|
|||||||
|
|
||||||
/// Update the configuration.
|
/// Update the configuration.
|
||||||
pub fn changeConfig(self: *Metal, config: *DerivedConfig) !void {
|
pub fn changeConfig(self: *Metal, config: *DerivedConfig) !void {
|
||||||
// If font thickening settings change, we need to reset our
|
// On configuration change we always reset our font group. There
|
||||||
// font texture completely because we need to re-render the glyphs.
|
// are a variety of configurations that can change font settings
|
||||||
if (self.config.font_thicken != config.font_thicken) {
|
// so to be safe we just always reset it. This has a performance hit
|
||||||
self.font_group.reset();
|
// when its not necessary but config reloading shouldn't be so
|
||||||
self.font_group.atlas_greyscale.clear();
|
// common to cause a problem.
|
||||||
self.font_group.atlas_color.clear();
|
self.font_group.reset();
|
||||||
}
|
self.font_group.atlas_greyscale.clear();
|
||||||
|
self.font_group.atlas_color.clear();
|
||||||
|
|
||||||
// We always redo the font shaper in case font features changed. We
|
// We always redo the font shaper in case font features changed. We
|
||||||
// could check to see if there was an actual config change but this is
|
// could check to see if there was an actual config change but this is
|
||||||
|
@ -1205,13 +1205,14 @@ fn gridSize(self: *const OpenGL, screen_size: renderer.ScreenSize) renderer.Grid
|
|||||||
|
|
||||||
/// Update the configuration.
|
/// Update the configuration.
|
||||||
pub fn changeConfig(self: *OpenGL, config: *DerivedConfig) !void {
|
pub fn changeConfig(self: *OpenGL, config: *DerivedConfig) !void {
|
||||||
// If font thickening settings change, we need to reset our
|
// On configuration change we always reset our font group. There
|
||||||
// font texture completely because we need to re-render the glyphs.
|
// are a variety of configurations that can change font settings
|
||||||
if (self.config.font_thicken != config.font_thicken) {
|
// so to be safe we just always reset it. This has a performance hit
|
||||||
self.font_group.reset();
|
// when its not necessary but config reloading shouldn't be so
|
||||||
self.font_group.atlas_greyscale.clear();
|
// common to cause a problem.
|
||||||
self.font_group.atlas_color.clear();
|
self.font_group.reset();
|
||||||
}
|
self.font_group.atlas_greyscale.clear();
|
||||||
|
self.font_group.atlas_color.clear();
|
||||||
|
|
||||||
// We always redo the font shaper in case font features changed. We
|
// We always redo the font shaper in case font features changed. We
|
||||||
// could check to see if there was an actual config change but this is
|
// could check to see if there was an actual config change but this is
|
||||||
|
Reference in New Issue
Block a user