From 9f84c7548649980f5af0c0d54fe29550a5bda16e Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Fri, 5 Nov 2010 17:36:40 -0700 Subject: [PATCH] More MDC tests --- test/public/tests.js | 65 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/test/public/tests.js b/test/public/tests.js index ba6909e..317033f 100644 --- a/test/public/tests.js +++ b/test/public/tests.js @@ -95,6 +95,54 @@ tests['rotate()'] = function(ctx){ ctx.stroke(); }; +tests['rotate() 2'] = function(ctx){ + ctx.translate(75,75); + + for (var i=1;i<6;i++){ // Loop through rings (from inside to out) + ctx.save(); + ctx.fillStyle = 'rgb('+(51*i)+','+(255-51*i)+',255)'; + + for (var j=0;j20000) break; + var x2 = (R+r)*Math.cos(i*Math.PI/72) - (r+O)*Math.cos(((R+r)/r)*(i*Math.PI/72)) + var y2 = (R+r)*Math.sin(i*Math.PI/72) - (r+O)*Math.sin(((R+r)/r)*(i*Math.PI/72)) + ctx.lineTo(x2,y2); + x1 = x2; + y1 = y2; + i++; + } while (x2 != R-O && y2 != 0 ); + ctx.stroke(); + } +}; + tests['rect()'] = function(ctx){ ctx.rect(5,5,50,50); ctx.strokeStyle = 'yellow'; @@ -261,6 +309,21 @@ tests['line caps'] = function(ctx){ } }; +tests['line join'] = function(ctx){ + var lineJoin = ['round','bevel','miter']; + ctx.lineWidth = 10; + for (var i=0;i