public RadicalDisplay(ListDisplay <TFont, TGlyph> innerDisplay, IDownshiftableDisplay <TFont, TGlyph> glyph, PointF position, Range range) { Radicand = innerDisplay; _radicalGlyph = glyph; Position = position; Range = range; }
public FractionDisplay(ListDisplay <TFont, TGlyph> numeratorDisplay, ListDisplay <TFont, TGlyph> denominatorDisplay, PointF currentPosition, Range range) { Numerator = numeratorDisplay; Denominator = denominatorDisplay; _position = currentPosition; Range = range; UpdateNumeratorAndDenominatorPositions(); }
public void SetDegree(ListDisplay <TFont, TGlyph> degree, TFont degreeFont, FontMathTable <TFont, TGlyph> degreeFontMathTable) { var kernBefore = degreeFontMathTable.RadicalKernBeforeDegree(degreeFont); var kernAfter = degreeFontMathTable.RadicalKernAfterDegree(degreeFont); var raise = degreeFontMathTable.RadicalDegreeBottomRaise(degreeFont) * (this.Ascent - this.Descent); Degree = degree; _radicalShift = kernBefore + degree.Width + kernAfter; if (_radicalShift < 0) { kernBefore -= _radicalShift; _radicalShift = 0; } // Position of degree is relative to parent. Degree.Position = new PointF(this.Position.X + kernBefore, this.Position.Y + raise); // update the width by the _radicalShift Width = _radicalShift + _radicalGlyph.Width + Radicand.Width; _UpdateRadicandPosition(); }