From 45278fbb8b686758bcfd543a1256ef313435d908 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 29 Nov 2022 02:53:36 -0500 Subject: [PATCH] Fix bug where nil cells would sometimes render without styling --- backends/x/draw.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/backends/x/draw.go b/backends/x/draw.go index 0f13c7e..78aac53 100644 --- a/backends/x/draw.go +++ b/backends/x/draw.go @@ -49,8 +49,17 @@ func (backend *Backend) drawCells (forceRedraw bool) (areas []image.Rectangle) { cell := backend.application.GetForRendering(x, y) content := cell.Rune() + style := cell.Style() - if forceRedraw && content < 32 { continue } + if + forceRedraw && + content < 32 && + style & ( + stone.StyleHighlight | + stone.StyleUnderline) == 0 { + + continue + } areas = append(areas, backend.boundsOfCell(x, y)) backend.drawRune (