source: trunk/examples/script/context2d/scripts/rotate.js@ 1077

Last change on this file since 1077 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 427 bytes
Line 
1var ctx = document.getElementById('tutorial').getContext('2d');
2 ctx.translate(75,75);
3
4 for (i=1;i<6;i++){ // Loop through rings (from inside to out)
5 ctx.save();
6 ctx.fillStyle = 'rgb('+(51*i)+','+(255-51*i)+',255)';
7
8 for (j=0;j<i*6;j++){ // draw individual dots
9 ctx.rotate(Math.PI*2/(i*6));
10 ctx.beginPath();
11 ctx.arc(0,i*12.5,5,0,Math.PI*2,true);
12 ctx.fill();
13 }
14
15 ctx.restore();
16 }
Note: See TracBrowser for help on using the repository browser.