From 4625fe0f0be1fb6d4c400ea5d3cf83e1ee090360 Mon Sep 17 00:00:00 2001 From: Jeffrey Sun Date: Wed, 21 Dec 2016 13:33:46 -0800 Subject: [PATCH] use bezier curves instead of lines, so cat mouth is less sad --- js/render-fox.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/js/render-fox.js b/js/render-fox.js index db0ca96..3eea7e7 100644 --- a/js/render-fox.js +++ b/js/render-fox.js @@ -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();