Add back blinkingCellCount functionality

pull/1/head
cpsdqs 7 years ago
parent f53d3390c8
commit 39277fa958
Signed by untrusted user: cpsdqs
GPG Key ID: 3F59586BB7448DD1
  1. 5
      js/term/screen.js
  2. 6
      js/term/screen_renderer.js

@ -276,7 +276,8 @@ module.exports = class TermScreen extends EventEmitter {
screenSelection: selection,
screenAttrs: this.screenAttrs,
cursor: this.cursor,
statusScreen: this.window.statusScreen
statusScreen: this.window.statusScreen,
hasBlinkingCells: !!this.blinkingCellCount
})
}
@ -513,7 +514,7 @@ module.exports = class TermScreen extends EventEmitter {
let cellYInFrame = Math.floor(cell / frameWidth)
let index = (frameY + cellYInFrame) * this.window.width + frameX + cellXInFrame
if (this.screenAttrs[index] & ATTR_BLINK !== data[3] & ATTR_BLINK) {
if ((this.screenAttrs[index] & ATTR_BLINK) !== (data[3] & ATTR_BLINK)) {
if (data[3] & ATTR_BLINK) this.blinkingCellCount++
else this.blinkingCellCount--
}

@ -59,6 +59,7 @@ module.exports = class CanvasRenderer extends EventEmitter {
this.screenAttrs = []
this.screenSelection = []
this.cursor = {}
this.hasBlinkingCells = false
this.resetDrawn()
@ -73,6 +74,11 @@ module.exports = class CanvasRenderer extends EventEmitter {
}
render (reason, data) {
if ('hasBlinkingCells' in data && data.hasBlinkingCells !== this.hasBlinkingCells) {
if (data.hasBlinkingCells) this.resetBlink()
else clearInterval(this.blinkInterval)
}
Object.assign(this, data)
this.scheduleDraw(reason)
}

Loading…
Cancel
Save