if (!Draw.rect) {
  Draw.rect = function(x, y, w, h, tl, tr, br, bl) {
    if(!Canvas.configured) {
      console.warn("KAPhy Warning - You must use Canvas.configure(); before you can draw!");
      return;
    }
    
    var realX = x,
      realY = y,
      realW = w,
      realH = h;

    switch (Draw.currentRectMode) {
      case CORNERS:
        realW = w - x;
        realH = h - y;
        break;
      case RADIUS:
        realX = x + w / 2;
        realY = y + h / 2;
        realW = w * 2;
        realH = h * 2;
        break;
      case CENTER:
        realX = x - w / 2;
        realY = y - h / 2;
        break;
    }
    
    if(Canvas.configured) {
      realX = Canvas.getX(realX);
      realY = Canvas.getY(realY);
      realW = Canvas.getX(realW);
      realH = Canvas.getY(realH);
    }
    
    tl = tl || 0;
    tr = tr || 0;
    br = br || 0;
    bl = bl || 0;

    Canvas.context.beginPath();

    Canvas.context.moveTo(realX + Canvas.getX(tl), realY);
    Canvas.context.lineTo(realX + realW - Canvas.getX(tr), realY);
    Canvas.context.quadraticCurveTo(realX + realW, realY, realX + realW, realY + Canvas.getY(tr));
    Canvas.context.lineTo(realX + realW, realY + realH - Canvas.getX(br));
    Canvas.context.quadraticCurveTo(realX + realW, realY + realH, realX + realW - Canvas.getX(br), realY + realH);
    Canvas.context.lineTo(realX + Canvas.getX(bl), realY + realH);
    Canvas.context.quadraticCurveTo(x, realY + realH, realX, realY + realH - Canvas.getY(bl));
    Canvas.context.lineTo(realX, realY + Canvas.getY(tl));
    Canvas.context.quadraticCurveTo(realX, realY, realX + Canvas.getX(tl), realY);
    Canvas.context.closePath();

    Canvas.context.fill();
    Canvas.context.stroke();
  };
}

@@ -207,24 +207,178 @@
 %0A    %7D%0A    %0A
+    if(arguments.length %3E 8 %7C%7C arguments.length %3C 4) %7B%0A      console.warn(%22KAPhy Warning - Draw.rect() takes 4 - 8 arguments.%22);%0A      return;%0A    %7D%0A    %0A
     var real
@@ -990,25 +990,26 @@
  tr = tr %7C%7C 
-0
+tl
 ;%0A    br = b
@@ -1009,25 +1009,26 @@
  br = br %7C%7C 
-0
+tl
 ;%0A    bl = b
@@ -1032,17 +1032,18 @@
 = bl %7C%7C 
-0
+tl
 ;%0A%0A    C

Update rect.js