'use strict'; export function draw(canvas, size, fn) { const ctx = canvas.getContext("2d"); const scale = canvas.clientWidth/size; ctx.save(); ctx.scale(scale, scale); ctx.clearRect(0, 0, size, size); fn(ctx); ctx.restore(); }