# dnewcome/Donatello

added test cases for circle, ellipse, line, arc

1 parent c1ecdce commit e423fc117d3c16f2c80720715ce8be18db803a9c Dan Newcome committed Oct 2, 2011
Showing with 155 additions and 9 deletions.
1. +20 −9 tests/arc.html
2. +46 −0 tests/circle.html
3. +46 −0 tests/ellipse.html
4. +43 −0 tests/line.html
 @@ -12,14 +12,26 @@ var arc; function main() { var paper = Donatello.paper('paper-div', 20, 20, 600, 600 ); - rect = paper.rect( 100, 100, 2, 2 ); - arc = paper.arc( 100, 100, 75, 0, 150, { - stroke:'red', - 'stroke-width':30 - }); - } - function resize( evt ) { - arc.draw( evt.clientX%360 ); + + // test positioning: + // rect should mark center of arc + rect = paper.rect( 25, 25, 1, 1 ); + arc = paper.arc( 25, 25, 20, 0, 150 ); + + // test setting attribute during construction + arc = paper.arc( 75, 25, 20, 0, 150, { stroke:'red' } ); + + // test setting attribute + arc = paper.arc( 125, 25, 20, 0, 150 ); + arc.attr( { stroke:'blue' } ); + + // test setting attribute + arc = paper.arc( 175, 25, 20, 0, 150 ); + arc.attr( { t1:50 } ); + + // test setting attribute + arc = paper.arc( 225, 25, 20, 0, 150 ); + arc.attr( { 'stroke-width':3 } ); } -
 @@ -0,0 +1,46 @@ + + + + + + + + + + + +
+
+ +
 @@ -0,0 +1,46 @@ + + + + + + + + + + + +
+
+ +
 @@ -0,0 +1,43 @@ + + + + + + + + + + + +
+
+ +