开发者

How do I rotate a line in ruby shoes?

开发者 https://www.devze.com 2023-03-23 17:38 出处:网络
The rotate command i开发者_C百科n shoes rotates the entire canvas around its upper left corner. I only want to rotate a line (or other shape) around its own corner, though. How do I do that?Rotate doe

The rotate command i开发者_C百科n shoes rotates the entire canvas around its upper left corner. I only want to rotate a line (or other shape) around its own corner, though. How do I do that?


Rotate does not really rotate the already drawn figure etc. You actually apply it to the "pen" drawing on the canvas before the begining of the drawing it is like to turn your page on which you draw by some angle. You should therefore use it like that:

Shoes.app do
 line 20,20, 50, 50
 rotate 90
 stroke red
 line 20,20,50,50
end 

Notice the difference between red and black line

0

精彩评论

暂无评论...
验证码 换一张
取 消