From 39277fa958a05ea40921921593b7821814eafd78 Mon Sep 17 00:00:00 2001 From: cpsdqs Date: Sun, 8 Oct 2017 21:56:19 +0200 Subject: [PATCH] Add back blinkingCellCount functionality --- js/term/screen.js | 5 +++-- js/term/screen_renderer.js | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/js/term/screen.js b/js/term/screen.js index b59226c..f8d3d96 100644 --- a/js/term/screen.js +++ b/js/term/screen.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-- } diff --git a/js/term/screen_renderer.js b/js/term/screen_renderer.js index 052e3e7..b7461ca 100644 --- a/js/term/screen_renderer.js +++ b/js/term/screen_renderer.js @@ -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) }