add support for one point lines in imdraw

This commit is contained in:
faiface 2017-03-23 19:38:53 +01:00
parent 4bebc7e6e4
commit fb8424cd32
1 changed files with 5 additions and 1 deletions

View File

@ -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