Added grey background for special cells
This commit is contained in:
parent
e0b0505332
commit
1a7fd31643
|
@ -96,8 +96,16 @@ ascii.View.prototype.render = function() {
|
||||||
this.context.font = '15px Courier New';
|
this.context.font = '15px Courier New';
|
||||||
for (var i = startOffset.x; i < endOffset.x; i++) {
|
for (var i = startOffset.x; i < endOffset.x; i++) {
|
||||||
for (var j = startOffset.y; j < endOffset.y; j++) {
|
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));
|
var cellValue = this.state.getDrawValue(new ascii.Vector(i, j));
|
||||||
if (cellValue != null) {
|
if (cellValue != null) {
|
||||||
|
this.context.fillStyle = '#000000';
|
||||||
context.fillText(cellValue,
|
context.fillText(cellValue,
|
||||||
i * CHARACTER_PIXELS - this.offset.x + 3,
|
i * CHARACTER_PIXELS - this.offset.x + 3,
|
||||||
j * CHARACTER_PIXELS - this.offset.y - 2);
|
j * CHARACTER_PIXELS - this.offset.y - 2);
|
||||||
|
|
Loading…
Reference in New Issue