Skip to content

Wrong Filling #181

@setanarut

Description

@setanarut

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions