Skip to content
Discussion options

You must be logged in to vote

When you do intermediate moves, you break the polygon, try without them

import scene
import ui

with ui.ImageContext(100, 100) as ctx:
ui.set_color('red')
p = ui.Path()
p.move_to(10, 10)
p.line_to(30, 30)
#p.move_to(30, 30)
p.line_to(10, 30)
#p.move_to(10, 30)
p.line_to(10, 10)
#p.move_to(10, 10)
p.stroke()
p.fill()
ctx.get_image().show()

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@CatsAndChaos
Comment options

Answer selected by CatsAndChaos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants