vector.js 561 B

1234567891011121314151617
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var path_1 = require("./path");
  4. var Vector = /** @class */ (function () {
  5. function Vector(x, y) {
  6. this.type = path_1.PathType.VECTOR;
  7. this.x = x;
  8. this.y = y;
  9. }
  10. Vector.prototype.add = function (deltaX, deltaY) {
  11. return new Vector(this.x + deltaX, this.y + deltaY);
  12. };
  13. return Vector;
  14. }());
  15. exports.Vector = Vector;
  16. exports.isVector = function (path) { return path.type === path_1.PathType.VECTOR; };
  17. //# sourceMappingURL=vector.js.map