Fix character drawing process

This commit is contained in:
akiyosi 2024-09-29 00:12:10 +09:00
parent 2a5da0a517
commit 154e5e5344

View file

@ -2716,11 +2716,12 @@ func (w *Window) newTextCache(text string, highlight *Highlight, isNormalWidth b
)
}
width := float64(len(text)-1)*font.cellwidth + font.italicWidth
// width := float64(len(text)-1)*font.cellwidth + font.italicWidth
width := fontfallbacked.fontMetrics.HorizontalAdvance(text, -1)
fg := highlight.fg()
if !isNormalWidth {
width = fontfallbacked.fontMetrics.HorizontalAdvance(text, -1)
}
// if !isNormalWidth {
// width = fontfallbacked.fontMetrics.HorizontalAdvance(text, -1)
// }
// QImage default device pixel ratio is 1.0,
// So we set the correct device pixel ratio
@ -3516,7 +3517,7 @@ func (w *Window) focusGrid() {
}
// convertWindowsToUnixPath converts a Windows path to a Unix path as wslpath does.
func convertWindowsToUnixPath(winPath string) string {
func convertWindowsToUnixPath(winPath string) string {
unixPath := strings.ReplaceAll(winPath, `\`, `/`)
if len(unixPath) <= 2 {
return unixPath