Only enter updateBackgounds condition if cell changed

We want to check when the background changed or when the foreground
changed (and either the old or new value was inverse)
This commit is contained in:
Daniel Imms
2019-11-14 19:46:24 -08:00
parent 7652cd8af3
commit 24dc87af2c
@@ -254,7 +254,7 @@ export class RectangleRenderer {
const bg = model.cells[modelIndex + RENDER_MODEL_BG_OFFSET];
const fg = model.cells[modelIndex + RENDER_MODEL_FG_OFFSET];
const inverse = !!(fg & FgFlags.INVERSE);
if (bg !== currentBg || ((inverse || currentInverse) && fg !== currentFg)) {
if (bg !== currentBg || (fg !== currentFg && (currentInverse || inverse))) {
// A rectangle needs to be drawn if going from non-default to another color
if (currentBg !== 0 || (currentInverse && currentFg !== 0)) {
const offset = rectangleCount++ * INDICES_PER_RECTANGLE;