use bezier curves instead of lines, so cat mouth is less sad

This commit is contained in:
Jeffrey Sun 2016-12-21 13:33:46 -08:00
parent 4d648a288f
commit 4625fe0f0b
1 changed files with 9 additions and 2 deletions

View File

@ -105,8 +105,15 @@ function renderMouth(ctx, opts) {
break;
case "cat":
ctx.moveTo(opts.x - opts.width/2, opts.y + opts.height/2);
ctx.lineTo(opts.x, opts.y - opts.height/2);
ctx.lineTo(opts.x + opts.width/2, opts.y + opts.height/2);
ctx.bezierCurveTo(opts.x - opts.width/2, opts.y + opts.height/2,
opts.x, opts.y + opts.height/2,
opts.x, opts.y - opts.height/2
)
ctx.bezierCurveTo(
opts.x, opts.y - opts.height/2,
opts.x, opts.y + opts.height/2,
opts.x + opts.width/2, opts.y + opts.height/2
)
break;
}
ctx.stroke();