Make fractions take math component

This commit is contained in:
Dolan Miu
2020-10-12 22:13:03 +01:00
parent 700a74fd4c
commit daea8d2868
7 changed files with 35 additions and 39 deletions

View File

@ -1,18 +1,19 @@
import { XmlComponent } from "file/xml-components";
import { MathComponent } from "../math-component";
import { MathDenominator } from "./math-denominator";
import { MathNumerator } from "./math-numerator";
export interface IMathFractionOptions {
readonly numerator: MathNumerator;
readonly denominator: MathDenominator;
readonly numerator: MathComponent;
readonly denominator: MathComponent;
}
export class MathFraction extends XmlComponent {
constructor(options: IMathFractionOptions) {
super("m:f");
this.root.push(options.numerator);
this.root.push(options.denominator);
this.root.push(new MathNumerator(options.numerator));
this.root.push(new MathDenominator(options.denominator));
}
}