refactor some submodules into objects, submodules explicitly take parameters of what they need

This commit is contained in:
Jeffrey Sun 2016-12-19 15:30:43 -08:00
parent c982800b1a
commit 33674a9d49
2 changed files with 37 additions and 40 deletions

View file

@ -30,7 +30,7 @@ function renderHead(ctx, opts) {
drawEllipseByCenter(ctx, 0, 0, opts.width, opts.height, opts.color, null, opts.kappa);
ctx.restore();
ctx.clip();
drawEllipseByCenter(ctx, ctx.canvas.width / 2, ctx.canvas.height, opts.maskWidth, opts.maskHeight, '#fff', '#fff', 0.5);
drawEllipseByCenter(ctx, ctx.canvas.width / 2, ctx.canvas.height, opts.mask.width, opts.mask.height, '#fff', '#fff', 0.5);
}
function renderEars(ctx, opts) {