Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong line Cap style for closed shapes. #191

Open
setanarut opened this issue Sep 22, 2023 · 1 comment
Open

Wrong line Cap style for closed shapes. #191

setanarut opened this issue Sep 22, 2023 · 1 comment

Comments

@setanarut
Copy link

setanarut commented Sep 22, 2023

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 setanarut changed the title The end point of closed polylines with line thickness 1 looks bad. The start-end point of lines with line thickness less than three is drawn incorrectly Sep 23, 2023
@setanarut setanarut changed the title The start-end point of lines with line thickness less than three is drawn incorrectly Wrong line Cap style for closed shapes. Oct 3, 2023
@setanarut
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant