fix: clamp vector pack
This commit is contained in:
parent
a852a906be
commit
768102d481
|
@ -381,5 +381,7 @@ export function unpackFromUint32(uint32) {
|
|||
}
|
||||
|
||||
export function packToUint32(v) {
|
||||
return (v[1] << 16) | v[0];
|
||||
const x = Math.min(65535, Math.max(0, v[0]));
|
||||
const y = Math.min(65535, Math.max(0, v[1]));
|
||||
return (y << 16) | x;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user