From 1a7fd31643db3ae8b25554e176fa3d507f26f53c Mon Sep 17 00:00:00 2001 From: Lewis Hemens Date: Mon, 13 Jan 2014 23:39:58 +0000 Subject: [PATCH] Added grey background for special cells --- js-lib/view.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js-lib/view.js b/js-lib/view.js index cf1b829..47b9582 100644 --- a/js-lib/view.js +++ b/js-lib/view.js @@ -96,8 +96,16 @@ ascii.View.prototype.render = function() { this.context.font = '15px Courier New'; for (var i = startOffset.x; i < endOffset.x; i++) { for (var j = startOffset.y; j < endOffset.y; j++) { + if (this.state.isSpecial(new ascii.Vector(i, j))) { + this.context.fillStyle = '#F5F5F5'; + context.fillRect( + i * CHARACTER_PIXELS - this.offset.x, + (j - 1) * CHARACTER_PIXELS - this.offset.y, + CHARACTER_PIXELS, CHARACTER_PIXELS); + } var cellValue = this.state.getDrawValue(new ascii.Vector(i, j)); if (cellValue != null) { + this.context.fillStyle = '#000000'; context.fillText(cellValue, i * CHARACTER_PIXELS - this.offset.x + 3, j * CHARACTER_PIXELS - this.offset.y - 2);