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.
8 function drawBallInit(diameter) {
9 ballRadius = diameter / 2;
10 ballImage = document.getElementById('ballImage');
13 function drawBall(x, y, angle) {
15 canvasContext.translate(x, y);
16 canvasContext.rotate(angle);
17 canvasContext.drawImage(ballImage, -ballRadius, -ballRadius, ballDiameter,
19 canvasContext.restore();