Skip to content

lwpolyline vertices defined with spread #18

@ditjedatje

Description

@ditjedatje

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions