开发者

How do I rotate a line in ruby shoes?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜