add support for one point lines in imdraw
This commit is contained in:
parent
4bebc7e6e4
commit
fb8424cd32
|
@ -433,9 +433,13 @@ func (imd *IMDraw) outlineEllipseArc(radius pixel.Vec, low, high, thickness floa
|
|||
func (imd *IMDraw) polyline(thickness float64, closed bool) {
|
||||
points := imd.getAndClearPoints()
|
||||
|
||||
if len(points) < 2 {
|
||||
if len(points) == 0 {
|
||||
return
|
||||
}
|
||||
if len(points) == 1 {
|
||||
// one point special case
|
||||
points = append(points, points[0])
|
||||
}
|
||||
|
||||
// first point
|
||||
j, i := 0, 1
|
||||
|
|
Loading…
Reference in New Issue