transform.js
function drawRectangle(context) {
context.save();
context.moveTo(leftX, topY);
context.lineTo(leftX + width - cornerRadius, topY);
context.arcTo(leftX + width, topY, leftX + width, topY + cornerRadius,
cornerRadius);
context.lineTo(leftX + width, topY + height);
context.lineTo(leftX, topY + height);
context.closePath();
context.restore();
context.strokeStyle = "black";
context.stroke();
context.fillStyle = "yellow";
context.fill();
};
function drawEllipse(context, x, y, w, h) {
var s = h / w;
context.save();
context.beginPath();
context.translate(0, y - y * s);
context.scale(1, s);
context.arc(x + w / 2, y + w / 2, w / 2, 0, 2 * Math.PI, false);
context.restore();
};