Skip to content

Commit

Permalink
Merge pull request #69 from amperka/quad2
Browse files Browse the repository at this point in the history
Fixed. Array.fill() doesn't work with an empty array.
  • Loading branch information
PSVM-J authored Jul 16, 2018
2 parents a0a66b5 + 315ad27 commit 112c043
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/@amperka/quaddisplay2.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ QuadDisplay.prototype.display = function(str, alignRight) {

if (alignRight) {
if (this._data.length < 4) {
this._data = [].fill(SYMBOLS[' '], 0, 4 - this._data.length).concat(this._data);
this._data = new Array(4 - this._data.length).fill(SYMBOLS[' '], 0).concat(this._data);
}
this.frame(this._data.length - 4);
this.frame(this._data.length - 4);
} else {
if (this._data.length < 4) {
this._data = this._data.concat([].fill(SYMBOLS[' '], 0, 4 - this._data.length))
this._data = this._data.concat(new Array(4 - this._data.length).fill(SYMBOLS[' '], 0));
}
this.frame(0);
}

};

QuadDisplay.prototype.marquee = function(str, period) {
Expand Down

0 comments on commit 112c043

Please sign in to comment.