Thursday, May 23, 2024
 Popular · Latest · Hot · Upcoming
185
rated 0 times [  186] [ 1]  / answers: 1 / hits: 18221  / 13 Years ago, sat, may 14, 2011, 12:00:00

im tried to rotate a line with this



window.onload= function(){
var canvas=document.getElementById(foo);
var context=canvas.getContext(2d);

context.moveTo(250, 50);
context.lineTo(250, 250);
context.stroke();
context.rotate(0.30);

};


what am i doing wrong? i think im missing some steps. can anyone explain?


More From » html

 Answers
18

Use this instead:



context.rotate(0.30); // <<< set current transformation to rotated
context.moveTo(250, 50);
context.lineTo(250, 250);
context.stroke();

[#92247] Thursday, May 12, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
oswaldoh

Total Points: 109
Total Questions: 93
Total Answers: 113

Location: Israel
Member since Wed, Apr 14, 2021
3 Years ago
;