src/js/CanvasDrawingTools.js
function roundedRect(ctx, x, y, width, height, radius) {
    // from MDN docs
    ctx.beginPath();
    ctx.moveTo(x, y + radius);
    ctx.lineTo(x, y + height - radius);
    ctx.quadraticCurveTo(x, y + height, x + radius, y + height);
    ctx.lineTo(x + width - radius, y + height);
    ctx.quadraticCurveTo(x + width, y + height, x + width, y + height
        - radius);
    ctx.lineTo(x + width, y + radius);
    ctx.quadraticCurveTo(x + width, y, x + width - radius, y);
    ctx.lineTo(x + radius, y);
    ctx.quadraticCurveTo(x, y, x, y + radius);
    ctx.stroke();
    ctx.fill();
  }
function roundedRect(ctx, x, y, width, height, radius) {
    // from MDN docs
    ctx.beginPath();
    ctx.moveTo(x, y + radius);
    ctx.lineTo(x, y + height - radius);
    ctx.quadraticCurveTo(x, y + height, x + radius, y + height);
    ctx.lineTo(x + width - radius, y + height);
    ctx.quadraticCurveTo(x + width, y + height, x + width, y + height
        - radius);
    ctx.lineTo(x + width, y + radius);
    ctx.quadraticCurveTo(x + width, y, x + width - radius, y);
    ctx.lineTo(x + radius, y);
    ctx.quadraticCurveTo(x, y, x, y + radius);
    ctx.stroke();
    ctx.fill();
  }
function roundedRect ( ctx , x , y , width , height , radius ) { // from MDN docs ctx . beginPath ( ) ; ctx . moveTo ( x , y + radius ) ; ctx . lineTo ( x , y + height - radius ) ; ctx . quadraticCurveTo ( x , y + height , x + radius , y + height ) ; ctx . lineTo ( x + width - radius , y + height ) ; ctx . quadraticCurveTo ( x + width , y + height , x + width , y + height - radius ) ; ctx . lineTo ( x + width , y + radius ) ; ctx . quadraticCurveTo ( x + width , y , x + width - radius , y ) ; ctx . lineTo ( x + radius , y ) ; ctx . quadraticCurveTo ( x , y , x , y + radius ) ; ctx . stroke ( ) ; ctx . fill ( ) ; }
Draws a rounded rectangle
@param ctx
@param x
@param y
@param width
@param height
@param radius
Draws a rounded rectangle