aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolden Rohrer <holden.rohrer@gmail.com>2019-12-27 01:31:18 -0500
committerHolden Rohrer <holden.rohrer@gmail.com>2019-12-27 14:57:57 -0500
commit73cd58b75cd881adf87de1ba31cf29e71897c885 (patch)
tree01a627cca056176e6bf5c3ef471430fc03022019
parent1132472fb8d4d8232e531b4563801df0692d6839 (diff)
Space now parses all of this.data
-rw-r--r--space.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/space.js b/space.js
index 86bd067..4159fc9 100644
--- a/space.js
+++ b/space.js
@@ -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]] || '');
}
}
}