translate.js 832 B

123456789101112131415161718192021
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.translate = void 0;
  4. /* eslint-disable @typescript-eslint/no-unused-vars */
  5. var matrix_util_1 = require("@antv/matrix-util");
  6. /**
  7. * Apply translate transformation for current vector.
  8. * @param params [tx, ty]
  9. * @param x x of the the bounding box of coordinate
  10. * @param y y of the the bounding box of coordinate
  11. * @param width width of the the bounding box of coordinate
  12. * @param height height of the the bounding box of coordinate
  13. * @returns transformer
  14. */
  15. var translate = function (params, x, y, width, height) {
  16. var _a = params, tx = _a[0], ty = _a[1];
  17. var matrix = matrix_util_1.mat3.create();
  18. return matrix_util_1.mat3.fromTranslation(matrix, [tx, ty]);
  19. };
  20. exports.translate = translate;
  21. //# sourceMappingURL=translate.js.map