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

lwpolyline vertices defined with spread #18

Open
ditjedatje opened this issue Feb 2, 2024 · 0 comments
Open

lwpolyline vertices defined with spread #18

ditjedatje opened this issue Feb 2, 2024 · 0 comments

Comments

@ditjedatje
Copy link

Hi,

I bumped into this problem:

func (d *Drawing) LwPolyline(closed bool, vertices ... []float64) (*entity.LwPolyline, error) {
	size := len(vertices)
	l := entity.NewLwPolyline(size)
	for i := 0; i < size; i++ {
		l.Vertices[i] = vertices[i]
	}
	if closed {
		l.Close()
	}
	l.SetLayer(d.CurrentLayer)
	d.AddEntity(l)
	return l, nil
}

shouldn't this be:

func (d *Drawing) LwPolyline(closed bool, vertices [][]float64) (*entity.LwPolyline, error) {

Where the spread operator is replaced with a [] so the vertices are correct.
I tested this change and it works fine.

Thanks

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