From 77db92bc420942b6df1d89cfe63cc5351acc84db Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 24 Aug 2017 16:23:02 -0700 Subject: [PATCH] Fix off by one error in the path color buffer --- demo/client/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/demo/client/src/index.ts b/demo/client/src/index.ts index d4883107..9dd0757b 100644 --- a/demo/client/src/index.ts +++ b/demo/client/src/index.ts @@ -677,11 +677,11 @@ class PathfinderView { } uploadPathData(pathCount: number) { - const pathColors = new Uint8Array(4 * pathCount); + const pathColors = new Uint8Array(4 * (pathCount + 1)); for (let pathIndex = 0; pathIndex < pathCount; pathIndex++) { for (let channel = 0; channel < 3; channel++) - pathColors[pathIndex * 4 + channel] = 0x00; // RGB - pathColors[pathIndex * 4 + 3] = 0xff; // alpha + pathColors[(pathIndex + 1) * 4 + channel] = 0x00; // RGB + pathColors[(pathIndex + 1) * 4 + 3] = 0xff; // alpha } this.pathColorsBufferTexture.upload(this.gl, pathColors);