1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 function drawBallInit(diameter) {
8 ballRadius = diameter / 2;
11 function drawBall(x, y, angle) {
13 canvasContext.fillStyle = 'blue';
14 canvasContext.translate(x, y);
15 canvasContext.rotate(angle);
16 canvasContext.fillRect(-ballRadius, -ballRadius, ballDiameter, ballDiameter);
17 canvasContext.restore();