translate.js 667 B

1234567891011121314151617
  1. /* eslint-disable @typescript-eslint/no-unused-vars */
  2. import { mat3 } from '@antv/matrix-util';
  3. /**
  4. * Apply translate transformation for current vector.
  5. * @param params [tx, ty]
  6. * @param x x of the the bounding box of coordinate
  7. * @param y y of the the bounding box of coordinate
  8. * @param width width of the the bounding box of coordinate
  9. * @param height height of the the bounding box of coordinate
  10. * @returns transformer
  11. */
  12. export var translate = function (params, x, y, width, height) {
  13. var _a = params, tx = _a[0], ty = _a[1];
  14. var matrix = mat3.create();
  15. return mat3.fromTranslation(matrix, [tx, ty]);
  16. };
  17. //# sourceMappingURL=translate.js.map