|
|
@ -622,7 +622,7 @@ class TermScreen { |
|
|
|
ctx.fillRect(x * cellWidth, y * cellHeight, Math.ceil(cellWidth), Math.ceil(cellHeight)) |
|
|
|
ctx.fillRect(x * cellWidth, y * cellHeight, Math.ceil(cellWidth), Math.ceil(cellHeight)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
drawCell ({ x, y, charSize, cellWidth, cellHeight, text, fg, bg, attrs }) { |
|
|
|
drawCell ({ x, y, charSize, cellWidth, cellHeight, text, fg, attrs }) { |
|
|
|
if (!text) return |
|
|
|
if (!text) return |
|
|
|
|
|
|
|
|
|
|
|
const ctx = this.ctx |
|
|
|
const ctx = this.ctx |
|
|
@ -851,7 +851,7 @@ class TermScreen { |
|
|
|
|
|
|
|
|
|
|
|
if (redrawMap.get(cell)) { |
|
|
|
if (redrawMap.get(cell)) { |
|
|
|
this.drawCell({ |
|
|
|
this.drawCell({ |
|
|
|
x, y, charSize, cellWidth, cellHeight, text, fg, bg, attrs |
|
|
|
x, y, charSize, cellWidth, cellHeight, text, fg, attrs |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.drawnScreen[cell] = text |
|
|
|
this.drawnScreen[cell] = text |
|
|
@ -888,13 +888,14 @@ class TermScreen { |
|
|
|
ctx.clip() |
|
|
|
ctx.clip() |
|
|
|
|
|
|
|
|
|
|
|
// swap foreground/background
|
|
|
|
// swap foreground/background
|
|
|
|
fg = this.screenBG[cell] |
|
|
|
;[fg, bg] = [bg, fg] |
|
|
|
bg = this.screenFG[cell] |
|
|
|
|
|
|
|
// HACK: ensure cursor is visible
|
|
|
|
// HACK: ensure cursor is visible
|
|
|
|
if (fg === bg) bg = fg === 0 ? 7 : 0 |
|
|
|
if (fg === bg) bg = fg === 0 ? 7 : 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.drawCellBackground({ x, y, cellWidth, cellHeight, bg }) |
|
|
|
this.drawCell({ |
|
|
|
this.drawCell({ |
|
|
|
x, y, charSize, cellWidth, cellHeight, text, fg, bg, attrs |
|
|
|
x, y, charSize, cellWidth, cellHeight, text, fg, attrs |
|
|
|
}) |
|
|
|
}) |
|
|
|
ctx.restore() |
|
|
|
ctx.restore() |
|
|
|
} |
|
|
|
} |
|
|
|