Make bg colors work with spaces

This commit is contained in:
bloeys
2022-09-25 03:00:44 +04:00
parent a127b72960
commit cee34de278

View File

@ -319,10 +319,7 @@ func (gr *GlyphRend) ScreenPosToGridPos(x, y float32) (gridX, gridY float32) {
func (gr *GlyphRend) drawRune(run *TextRun, i int, prevRune rune, pos *gglm.Vec3, color *gglm.Vec4, lineHeightF32 float32, bufIndex *uint32) { func (gr *GlyphRend) drawRune(run *TextRun, i int, prevRune rune, pos *gglm.Vec3, color *gglm.Vec4, lineHeightF32 float32, bufIndex *uint32) {
r := run.Runes[i] r := run.Runes[i]
if r == ' ' { if r == '\t' {
pos.AddX(gr.Atlas.SpaceAdvance)
return
} else if r == '\t' {
pos.AddX(gr.Atlas.SpaceAdvance * float32(gr.SpacesPerTab)) pos.AddX(gr.Atlas.SpaceAdvance * float32(gr.SpacesPerTab))
return return
} }