Fix invisible cursors

cpsdqs/unified-input
cpsdqs 7 years ago
parent a78db76327
commit d5f6bf2dfa
Signed by untrusted user: cpsdqs
GPG Key ID: 3F59586BB7448DD1
  1. 11
      jssrc/term_screen.js

@ -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()
} }

Loading…
Cancel
Save