From 7d02616133ac1ad8854be830b7720adad4aae745 Mon Sep 17 00:00:00 2001 From: akiyosi Date: Fri, 26 Jan 2024 20:50:35 +0900 Subject: [PATCH] Fix an issue where drawn text would flicker slightly when moving the cursor. --- editor/font.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/font.go b/editor/font.go index 9ddc9702..0c68031d 100644 --- a/editor/font.go +++ b/editor/font.go @@ -50,7 +50,7 @@ func initFontNew(family string, size float64, weight gui.QFont__Weight, stretch, // font := gui.NewQFont2(family, size, int(gui.QFont__Normal), false) font := gui.NewQFont() if editor.config.Editor.ManualFontFallback { - font.SetStyleHint(gui.QFont__TypeWriter, gui.QFont__NoFontMerging) + font.SetStyleHint(gui.QFont__TypeWriter, gui.QFont__NoFontMerging|gui.QFont__ForceIntegerMetrics) } else { font.SetStyleHint(gui.QFont__TypeWriter, gui.QFont__PreferDefault|gui.QFont__ForceIntegerMetrics) } @@ -92,7 +92,7 @@ func (f *Font) change(family string, size float64, weight gui.QFont__Weight, str f.qfont.SetFamily(family) if editor.config.Editor.ManualFontFallback { - f.qfont.SetStyleHint(gui.QFont__TypeWriter, gui.QFont__NoFontMerging) + f.qfont.SetStyleHint(gui.QFont__TypeWriter, gui.QFont__NoFontMerging|gui.QFont__ForceIntegerMetrics) } else { f.qfont.SetStyleHint(gui.QFont__TypeWriter, gui.QFont__PreferDefault|gui.QFont__ForceIntegerMetrics) }