fogleman / gg

Go Graphics - 2D rendering in Go with a simple API.
https://godoc.org/github.com/fogleman/gg
MIT License
4.37k stars 354 forks source link

DrawArc: getting rid of the line connecting the center with the beginning. #106

Closed lucasepe closed 4 years ago

lucasepe commented 4 years ago

Hi! First of all thanks! for your awesome library!

I'm using gg to create illustrations about how to do "geometric constructions" . As you can see in the attached image, drawing arcs shows always the line from the center to the beginning of the arc. frame2

I wonder if it would be possible to get rid of that line - drawing only the arc.

I'm asking for this becouse when the drawing becomes more complex, the result becomes confused.

frame6

Maybe it's already possible but I'm missing something?

Thanks!

fogleman commented 4 years ago

This should only happen if the context currently has an active path before drawing the arc.

Try dc.NewSubPath() before drawing your arc.

lucasepe commented 4 years ago

Thank you very much! It works now...and I learned something new!

sample2

All the best, Luca

fogleman commented 4 years ago

Nice! I love polygon construction, nice to see this!