diff --git a/Sources/kha/graphics4/Graphics2.hx b/Sources/kha/graphics4/Graphics2.hx index e6fdad1ce..ce0afb8c0 100644 --- a/Sources/kha/graphics4/Graphics2.hx +++ b/Sources/kha/graphics4/Graphics2.hx @@ -413,7 +413,7 @@ class ColoredShaderPainter { triangleIndexBuffer = new IndexBuffer(triangleBufferSize * 3, Usage.StaticUsage); var triIndices = triangleIndexBuffer.lock(); - for (i in 0...bufferSize) { + for (i in 0...triangleBufferSize) { triIndices[i * 3 + 0] = i * 3 + 0; triIndices[i * 3 + 1] = i * 3 + 1; triIndices[i * 3 + 2] = i * 3 + 2;