예제 #1
0
 public MathFormulaDrawable(MathFormula formula, IMathSymbolConverter converter)
     : base(formula.Level, formula.Sizes)
 {
     sizes = formula.Sizes;
     for (int i = 0; i < formula.Count; i++)
     {
         MathSymbol s   = formula[i];
         MathSymbol sym = converter.Convert(s);
         sym.Sizes = sizes;
         sym.Append(this);
         sym = Last;
         for (int j = 0; j < s.Count; j++)
         {
             if (j >= sym.Count)
             {
                 break;
             }
             if (s[j] != null)
             {
                 s[j].Sizes = sizes;
                 sym[j]     = new MathFormulaDrawable(s[j], converter);
             }
         }
     }
 }
예제 #2
0
 /// <summary>
 /// Constructor from prototype
 /// </summary>
 /// <param name="formula">Prototype</param>
 /// <param name="converter">Symbol converter</param>
 public MathFormula(MathFormula formula, IMathSymbolConverter converter)
     : this(formula.Level, formula.Sizes)
 {
     for (int i = 0; i < formula.Count; i++)
     {
         MathSymbol s   = formula[i];
         MathSymbol sym = converter.Convert(s);
         sym.Append(this);
         sym = Last;
         for (int j = 0; j < s.Count; j++)
         {
             if (s[j] != null)
             {
                 sym[j] = new MathFormula(s[j], converter);
             }
         }
     }
 }