diff --git a/x/canvas/draw.go b/x/canvas/draw.go index 187528e..678d480 100644 --- a/x/canvas/draw.go +++ b/x/canvas/draw.go @@ -215,7 +215,7 @@ type fillingContext struct { } func (context *fillingContext) fillPolygonHotOpaque () { - for index := 0; index < len(context.boundaries); index += 2 { + for index := 0; index < len(context.boundaries) - 1; index += 2 { left := context.boundaries[index] right := context.boundaries[index + 1] @@ -240,7 +240,7 @@ func (context *fillingContext) fillPolygonHotOpaque () { } func (context *fillingContext) fillPolygonHotTransparent () { - for index := 0; index < len(context.boundaries); index += 2 { + for index := 0; index < len(context.boundaries) - 1; index += 2 { left := context.boundaries[index] right := context.boundaries[index + 1]