Skip to content

Commit b18932b

Browse files
committed
Fix for table buffer
The buffer was bigger than the array and not translating correctly.
1 parent 1dfbacc commit b18932b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/managers/tablemgr.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,11 @@ private buffer: Uint8Array = new Uint8Array();
179179
i += 3;
180180
}
181181
else if (data[i] == this.TypeFloat) {
182-
const view = new DataView(data.buffer, i+2, 4);
183-
const val = Math.round(view.getFloat32(0, true) * 1e4) / 1e4;
184-
this.tableArray[data[i+1]] = val;
182+
const buff = data.buffer;
183+
const view = new DataView(buff, data.byteOffset+i+2, 4);
184+
const val1 = view.getFloat32(0, true);
185+
//const val = Math.round(view.getFloat32(0, true) * 1e4) / 1e4;
186+
this.tableArray[data[i+1]] = val1;
185187
i += 6
186188
}
187189
}

0 commit comments

Comments
 (0)