Skip to content

Commit

Permalink
Fixed. Array.fill() doesn't work with an empty array.
Browse files Browse the repository at this point in the history
  • Loading branch information
PSVM-J committed Jul 12, 2018
1 parent a0a66b5 commit 315ad27
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 315ad27

Please sign in to comment.