don't draw line on turtle if pen is up
This commit is contained in:
parent
fe5b196404
commit
b9e721e4e2
|
@ -1111,7 +1111,8 @@ fn render_turtle! () -> {
|
||||||
add_call! ((:fill, r, g, b, a))
|
add_call! ((:fill, r, g, b, a))
|
||||||
let #{heading
|
let #{heading
|
||||||
:pencolor (pen_r, pen_g, pen_b, pen_a)
|
:pencolor (pen_r, pen_g, pen_b, pen_a)
|
||||||
:position (x, y)
|
:position (x, y)
|
||||||
|
pendown?
|
||||||
...} = state
|
...} = state
|
||||||
let first = mult ((0, 1), turtle_radius)
|
let first = mult ((0, 1), turtle_radius)
|
||||||
let (x1, y1) = first
|
let (x1, y1) = first
|
||||||
|
@ -1128,7 +1129,7 @@ fn render_turtle! () -> {
|
||||||
add_call! ((:endShape))
|
add_call! ((:endShape))
|
||||||
& there's a happy bug here: the stroke will be the same width as the pen width. Keep this for now. Consider also showing the pen colour here?
|
& there's a happy bug here: the stroke will be the same width as the pen width. Keep this for now. Consider also showing the pen colour here?
|
||||||
add_call! ((:stroke, pen_r, pen_g, pen_b, pen_a))
|
add_call! ((:stroke, pen_r, pen_g, pen_b, pen_a))
|
||||||
add_call! ((:line, 0, 0, x1, y1))
|
if pendown? then add_call! ((:line, 0, 0, x1, y1)) else nil
|
||||||
add_call! ((:pop))
|
add_call! ((:pop))
|
||||||
:ok
|
:ok
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user