mroot.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. "use strict";
  2. var __extends = (this && this.__extends) || (function () {
  3. var extendStatics = function (d, b) {
  4. extendStatics = Object.setPrototypeOf ||
  5. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  7. return extendStatics(d, b);
  8. };
  9. return function (d, b) {
  10. if (typeof b !== "function" && b !== null)
  11. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  12. extendStatics(d, b);
  13. function __() { this.constructor = d; }
  14. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  15. };
  16. })();
  17. var __read = (this && this.__read) || function (o, n) {
  18. var m = typeof Symbol === "function" && o[Symbol.iterator];
  19. if (!m) return o;
  20. var i = m.call(o), r, ar = [], e;
  21. try {
  22. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  23. }
  24. catch (error) { e = { error: error }; }
  25. finally {
  26. try {
  27. if (r && !r.done && (m = i["return"])) m.call(i);
  28. }
  29. finally { if (e) throw e.error; }
  30. }
  31. return ar;
  32. };
  33. Object.defineProperty(exports, "__esModule", { value: true });
  34. exports.SVGmroot = void 0;
  35. var msqrt_js_1 = require("./msqrt.js");
  36. var mroot_js_1 = require("../../common/Wrappers/mroot.js");
  37. var mroot_js_2 = require("../../../core/MmlTree/MmlNodes/mroot.js");
  38. var SVGmroot = (function (_super) {
  39. __extends(SVGmroot, _super);
  40. function SVGmroot() {
  41. return _super !== null && _super.apply(this, arguments) || this;
  42. }
  43. SVGmroot.prototype.addRoot = function (ROOT, root, sbox, H) {
  44. root.toSVG(ROOT);
  45. var _a = __read(this.getRootDimens(sbox, H), 3), x = _a[0], h = _a[1], dx = _a[2];
  46. var bbox = root.getOuterBBox();
  47. root.place(dx * bbox.rscale, h);
  48. this.dx = x;
  49. };
  50. SVGmroot.kind = mroot_js_2.MmlMroot.prototype.kind;
  51. return SVGmroot;
  52. }((0, mroot_js_1.CommonMrootMixin)(msqrt_js_1.SVGmsqrt)));
  53. exports.SVGmroot = SVGmroot;
  54. //# sourceMappingURL=mroot.js.map