diff options
-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]] || ''); } } } |