fogleman / gg

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

Wrong line Cap style for closed shapes. #191

Open setanarut opened 10 months ago

setanarut commented 10 months ago

There is an unwanted blemish on the default circle shape. line start and end points overlap.

Ekran Resmi 2023-09-22 06 54 27

package main

import (
    "github.com/fogleman/gg"
)

func main() {
    d := gg.NewContext(200, 200)
    d.SetHexColor("000")
    d.Clear()
    d.SetHexColor("FFF")
    d.DrawCircle(100, 100, 50)
    // d.SetLineCapButt() <- this should be the default style and belong to the circle.
    d.Stroke()
    d.SavePNG("canvas.png")
}

canvas

setanarut commented 9 months ago

I wrote my own library that provides more line styles and smoother rasterization, maybe someone will need it. https://pkg.go.dev/github.com/setanarut/gog