pixi.js
Version:
<p align="center"> <a href="https://pixijs.com" target="_blank" rel="noopener noreferrer"> <img height="150" src="https://files.pixijs.download/branding/pixijs-logo-transparent-dark.svg?v=1" alt="PixiJS logo"> </a> </p> <br/> <p align="center">
24 lines (22 loc) • 564 B
JavaScript
;
function applyMatrix(array, stride, offset, matrix) {
let index = 0;
const size = array.length / (stride || 2);
const a = matrix.a;
const b = matrix.b;
const c = matrix.c;
const d = matrix.d;
const tx = matrix.tx;
const ty = matrix.ty;
offset *= stride;
while (index < size) {
const x = array[offset];
const y = array[offset + 1];
array[offset] = a * x + c * y + tx;
array[offset + 1] = b * x + d * y + ty;
offset += stride;
index++;
}
}
export { applyMatrix };
//# sourceMappingURL=applyMatrix.mjs.map