util.js 656 B

1234567891011121314
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.toResult = exports.normalizePoint = void 0;
  4. const x6_common_1 = require("@antv/x6-common");
  5. const x6_geometry_1 = require("@antv/x6-geometry");
  6. function normalizePoint(bbox, args = {}) {
  7. return new x6_geometry_1.Point(x6_common_1.NumberExt.normalizePercentage(args.x, bbox.width), x6_common_1.NumberExt.normalizePercentage(args.y, bbox.height));
  8. }
  9. exports.normalizePoint = normalizePoint;
  10. function toResult(point, angle, rawArgs) {
  11. return Object.assign({ angle, position: point.toJSON() }, rawArgs);
  12. }
  13. exports.toResult = toResult;
  14. //# sourceMappingURL=util.js.map