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, screenSelection: selection,
screenAttrs: this.screenAttrs, screenAttrs: this.screenAttrs,
cursor: this.cursor, 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 cellYInFrame = Math.floor(cell / frameWidth)
let index = (frameY + cellYInFrame) * this.window.width + frameX + cellXInFrame 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++ if (data[3] & ATTR_BLINK) this.blinkingCellCount++
else this.blinkingCellCount-- else this.blinkingCellCount--
} }

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

Loading…
Cancel
Save