aboutsummaryrefslogtreecommitdiff
path: root/space.js
diff options
context:
space:
mode:
Diffstat (limited to 'space.js')
-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]] || '');
}
}
}