msubsup.js 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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.SVGmsubsup = exports.SVGmsup = exports.SVGmsub = void 0;
  35. var scriptbase_js_1 = require("./scriptbase.js");
  36. var msubsup_js_1 = require("../../common/Wrappers/msubsup.js");
  37. var msubsup_js_2 = require("../../common/Wrappers/msubsup.js");
  38. var msubsup_js_3 = require("../../common/Wrappers/msubsup.js");
  39. var msubsup_js_4 = require("../../../core/MmlTree/MmlNodes/msubsup.js");
  40. var SVGmsub = (function (_super) {
  41. __extends(SVGmsub, _super);
  42. function SVGmsub() {
  43. return _super !== null && _super.apply(this, arguments) || this;
  44. }
  45. SVGmsub.kind = msubsup_js_4.MmlMsub.prototype.kind;
  46. return SVGmsub;
  47. }((0, msubsup_js_1.CommonMsubMixin)(scriptbase_js_1.SVGscriptbase)));
  48. exports.SVGmsub = SVGmsub;
  49. var SVGmsup = (function (_super) {
  50. __extends(SVGmsup, _super);
  51. function SVGmsup() {
  52. return _super !== null && _super.apply(this, arguments) || this;
  53. }
  54. SVGmsup.kind = msubsup_js_4.MmlMsup.prototype.kind;
  55. return SVGmsup;
  56. }((0, msubsup_js_2.CommonMsupMixin)(scriptbase_js_1.SVGscriptbase)));
  57. exports.SVGmsup = SVGmsup;
  58. var SVGmsubsup = (function (_super) {
  59. __extends(SVGmsubsup, _super);
  60. function SVGmsubsup() {
  61. return _super !== null && _super.apply(this, arguments) || this;
  62. }
  63. SVGmsubsup.prototype.toSVG = function (parent) {
  64. var svg = this.standardSVGnode(parent);
  65. var _a = __read([this.baseChild, this.supChild, this.subChild], 3), base = _a[0], sup = _a[1], sub = _a[2];
  66. var w = this.getBaseWidth();
  67. var x = this.getAdjustedIc();
  68. var _b = __read(this.getUVQ(), 2), u = _b[0], v = _b[1];
  69. base.toSVG(svg);
  70. sup.toSVG(svg);
  71. sub.toSVG(svg);
  72. sub.place(w, v);
  73. sup.place(w + x, u);
  74. };
  75. SVGmsubsup.kind = msubsup_js_4.MmlMsubsup.prototype.kind;
  76. return SVGmsubsup;
  77. }((0, msubsup_js_3.CommonMsubsupMixin)(scriptbase_js_1.SVGscriptbase)));
  78. exports.SVGmsubsup = SVGmsubsup;
  79. //# sourceMappingURL=msubsup.js.map