Skip to content

Instantly share code, notes, and snippets.

@starakaj
Created Apr 16, 2021
Embed
What would you like to do?
const makePaintFunction = template(`
mgraphics.relative_coords = 1;
function calcAspect() {
var width = this.box.rect[2] - this.box.rect[0];
var height = this.box.rect[3] - this.box.rect[1];
return width/height;
}
function paint() {
const aspect = calcAspect();
%%statements%%
}
`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment