Skip to content

Commit

Permalink
Fixed failure to bind "this" to the render function
Browse files Browse the repository at this point in the history
  • Loading branch information
Sollace committed Dec 4, 2020
1 parent fa6f187 commit 9dba5e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/mson_more.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
stretch: fixedLength(body.stretch, 3),
face: body.face
};
}, (parent, context) => {
}, function(parent, context) {
// TODO: rendering
});
Mson.addElementType('mson:planar', (loader, body, locals, model) => {
Expand Down Expand Up @@ -45,7 +45,7 @@
stretch: locals.array(fixedLength(body.stretch, 3)),
faces
};
}, (parent, context) => {
}, function(parent, context) {
const stretch = this.stretch(locals);

this.faces.forEach(set => {
Expand Down Expand Up @@ -90,7 +90,7 @@
u: body.u || 0,
v: body.v || 0
};
}, (parent, context) => {
}, function(parent, context) {

this.quads.forEach(quad => {
quad.forEach(vertex => {
Expand Down
4 changes: 2 additions & 2 deletions src/mson_vanilla.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
stretch: fixedLength(body.stretch, 3),
mirror: body.mirror
};
}, (parent, context) => {
}, function(parent, context) {
// TODO: rendering
});
Mson.addElementType('mson:compound', (loader, body, locals, model, defineName) => {
Expand All @@ -43,7 +43,7 @@
}

return element;
}, (parent, context) => {
}, function(parent, context) {
if (!this.visible) {
return;
}
Expand Down

0 comments on commit 9dba5e7

Please sign in to comment.