+ const referenceDimension = canvasWidth < canvasHeight ? canvasWidth : canvasHeight;
+
+ const heartSize = Math.round(referenceDimension * this.heartSize * .01);
+ const radius = heartSize / 2;
+ const canvasCenterX = Math.round(canvasWidth / 2);
+ const canvasCenterY = Math.round(canvasHeight / 2);
+ const centerX = -radius;
+ const centerY = -radius;
+
+
+ // translate and rotate, adjusting for weight of the heart.
+ context.translate(canvasCenterX, canvasCenterY + radius / 4);
+ context.rotate(-45 * Math.PI / 180);
+
+ // Fill the ventricles of the heart