diff options
author | Holden Rohrer <holden.rohrer@gmail.com> | 2019-12-27 01:31:18 -0500 |
---|---|---|
committer | Holden Rohrer <holden.rohrer@gmail.com> | 2019-12-27 14:57:57 -0500 |
commit | 73cd58b75cd881adf87de1ba31cf29e71897c885 (patch) | |
tree | 01a627cca056176e6bf5c3ef471430fc03022019 | |
parent | 1132472fb8d4d8232e531b4563801df0692d6839 (diff) |
Space now parses all of this.data
-rw-r--r-- | space.js | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -103,12 +103,10 @@ function Space(){ // Iterate over other.data and add to this.data while (this.data.length < offset[0]+other.data.length) this.data.push([]); // Row padding - for (let row = 0; row < other.data.length; row++){ - let thisrow = this.data[row+offset[0]]; - while (thisrow.length < offset[1]+other.data[row].length) thisrow.push(''); // Character-wise padding - for (let chr = 0; chr < other.data[row].length; chr++){ - let thechr = chr+offset[1]; - thisrow[thechr] = func(thisrow[thechr], other.data[row][chr]); + for (let row = 0; row < this.data.length; row++){ + while (this.data[row].length < offset[1]+other.data[row+offset[0]].length) thisrow.push(''); // Character-wise padding + for (let chr = 0; chr < this.data[row].length; chr++){ + thisrow[chr] = func(thisrow[chr], other.data[row+offset[0]][chr+offset[1]] || ''); } } } |