Fix out of bounds panic with polygon filling

This commit is contained in:
Sasha Koshka 2024-06-24 18:42:43 -04:00
parent fdcf254891
commit 1c803ff9c1

View File

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