line_left/line_up/line_down/line_right?

瀏覽次數:18 次
跳到第一則未讀訊息

RB Whitaker

未讀,
2018年11月25日 凌晨2:45:292018/11/25
收件者:Prawn
In Prawn, I have the ability to do move_up/move_down/move_left/move_right. I'm just wondering if there's a way to basically do the same thing, but plot a line to that point as you go. Like line_to, just with only needing to specify a relative amount to go.

Now that I'm thinking about it, I could probably make something easily enough on my own. I'm new to Prawn and Ruby, but I think I know enough to be able to build that. Of course, it would be silly to build my own if one exists already...

RB Whitaker

未讀,
2018年11月25日 下午1:21:282018/11/25
收件者:Prawn
I think I can see now that there is no move_left/move_right. Just up and down. Looks like the cursor is basically just a y component.

Edward Ellis

未讀,
2018年11月25日 晚上11:38:522018/11/25
收件者:Prawn
Have you read the manual "Prawn by example"?  The graphics section addresses these questions.  For example it identifies the move_to x, y and line_to x, y methods.

RB Whitaker

未讀,
2018年11月26日 晚上10:02:382018/11/26
收件者:Prawn
Well I wouldn't claim to have read the whole thing, but I have read enough to have read about move_to and line_to. It's just that there's a move_up and a move_down. I'm just wishing (hoping?) that there were a move_left x, where you can specify a relative amount to move in a specific direction (left). Guess that doesn't exist though?
回覆所有人
回覆作者
轉寄
0 則新訊息