thi-ng / umbrella

⛱ Broadly scoped ecosystem & mono-repository of 199 TypeScript projects (and ~180 examples) for general purpose, functional, data driven development
https://thi.ng
Apache License 2.0
3.39k stars 150 forks source link

[matrices] Identity function returns the wrong argument #352

Closed JakeCoxon closed 2 years ago

JakeCoxon commented 2 years ago

Identity and the set function seem to return a different argument to the out vec. Presumably not indented

Reproduce:

const m = identity44([]);  // Returns the frozen identity
m[0] = 1000 // Has no affect
console.log(m[0]) // 1

Looks like https://github.com/thi-ng/umbrella/blob/develop/packages/matrices/src/set.ts#L6 calls compile with default arg which is 'a' https://github.com/thi-ng/umbrella/blob/develop/packages/vectors/src/compile/emit.ts#L165 but all other functions that use vector set return the o argument https://github.com/thi-ng/umbrella/blob/develop/packages/vectors/src/set.ts#L9

postspectacular commented 2 years ago

Thank you for reporting this! Just fixed it & will release later tonight...

postspectacular commented 2 years ago

Oki, the fix is published now:

https://github.com/thi-ng/umbrella/blob/develop/packages/matrices/CHANGELOG.md#2122-2022-08-16