2 * Copyright (c) 2012, Intel Corporation.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
10 var cancelAudioGlowInterval = undefined;
12 function objectsAtLocation(pageObj, xLoc, yLoc)
17 for (i = 0; i < pageObj.canvasObjs.length; i++)
19 if (pageObj.canvasObjs[i] != undefined && pageObj.canvasObjs[i].visible != false)
21 currItem = pageObj.canvasObjs[i];
25 if (xLoc > currItem.xLoc && xLoc < (currItem.xLoc + currItem.width))
27 if (yLoc > currItem.yLoc && yLoc < (currItem.yLoc + currItem.height))
29 if (prevItem == undefined || (Number(currItem.ctx.canvas.style.zIndex) > Number(prevItem.ctx.canvas.style.zIndex)) ||
30 ((Number(currItem.ctx.canvas.style.zIndex) === Number(prevItem.ctx.canvas.style.zIndex)) && (currItem.zLoc > prevItem.zLoc)))
43 function clearCanvas()
45 buttonCtx.clearRect(0,0, screenWidth, screenHeight);
46 mainCtx.clearRect(0,0, screenWidth, screenHeight);
47 mouseCtx.clearRect(0,0, screenWidth, screenHeight);
50 function drawRoundedRectangle(ctx, xLoc, yLoc, width, height, cornerRadius, strokeStyle, fillStyle, lineWidth)
53 ctx.strokeStyle = strokeStyle;
54 ctx.lineWidth = lineWidth;
55 ctx.fillStyle = fillStyle;
57 ctx.moveTo(xLoc + cornerRadius, yLoc);
58 ctx.lineTo(xLoc + width - cornerRadius, yLoc);
59 ctx.quadraticCurveTo(xLoc + width, yLoc, xLoc + width, yLoc + cornerRadius);
60 ctx.lineTo(xLoc + width, yLoc + height - cornerRadius);
61 ctx.quadraticCurveTo(xLoc + width, yLoc + height, xLoc + width - cornerRadius, yLoc + height);
62 ctx.lineTo(xLoc + cornerRadius, yLoc + height);
63 ctx.quadraticCurveTo(xLoc, yLoc + height, xLoc, yLoc + height - cornerRadius);
64 ctx.lineTo(xLoc, yLoc + cornerRadius);
65 ctx.quadraticCurveTo(xLoc, yLoc, xLoc + cornerRadius, yLoc);