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 Filling #181

Open
setanarut opened this issue Sep 22, 2023 · 0 comments
Open

Wrong Filling #181

setanarut opened this issue Sep 22, 2023 · 0 comments
Labels

Comments

@setanarut
Copy link

It does not fill from the starting and ending points.

package main

import (
	"image"
	"image/color"

	"github.com/llgcode/draw2d/draw2dimg"
)

func main() {
	img := image.NewRGBA(image.Rect(0, 0, 400, 400))
	c := draw2dimg.NewGraphicContext(img)
	c.SetFillColor(color.Black)
	c.Clear()
	c.SetLineWidth(2)
	c.SetFillColor(color.RGBA{255, 0, 0, 255})
	c.SetStrokeColor(color.White)
	c.MoveTo(300, 50)
	c.LineTo(150, 286)
	c.LineTo(149, 113)
	// c.Close()
	c.FillStroke()
	draw2dimg.SaveToPngFile("triangle.png", img)
}

triangle

@llgcode llgcode added the bug label Sep 25, 2023
Repository owner deleted a comment from setanarut Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants