public static MathListIndex IndexForPoint <TFont, TGlyph>( this IGlyphDisplay <TFont, TGlyph> self, TypesettingContext <TFont, TGlyph> _, PointF point) where TFont : IFont <TGlyph> => point.X > self.Position.X + self.Width / 2 ? MathListIndex.Level0Index(self.Range.End) : MathListIndex.Level0Index(self.Range.Location);
public RadicalDisplay(ListDisplay <TFont, TGlyph> innerDisplay, IGlyphDisplay <TFont, TGlyph> glyph, PointF position, Range range) { Radicand = innerDisplay; _radicalGlyph = glyph; Position = position; Range = range; }
public InnerDisplay(ListDisplay <TFont, TGlyph> inner, IGlyphDisplay <TFont, TGlyph>?left, IGlyphDisplay <TFont, TGlyph>?right, Range range) { Inner = inner; Left = left; Right = right; Range = range; }
public static void HighlightCharacterAt <TFont, TGlyph>( this IGlyphDisplay <TFont, TGlyph> self, MathListIndex index, Color color) where TFont : IFont <TGlyph> { if (index.SubIndexType != MathListSubIndexType.None) { throw new ArgumentException ("The subindex must be none to get the highlight a character in it.", nameof(index)); } self.Highlight(color); }
public static PointF?PointForIndex <TFont, TGlyph>( this IGlyphDisplay <TFont, TGlyph> self, TypesettingContext <TFont, TGlyph> _, MathListIndex index) where TFont : IFont <TGlyph> => index.SubIndexType != MathListSubIndexType.None ? throw new ArgumentException ("The subindex must be none to get the closest point for it.", nameof(index)) : index.AtomIndex == self.Range.End // draw a caret after the glyph ? self.Position.Plus(new PointF(self.DisplayBounds().Right, 0)) // draw a caret before the glyph : self.Position;
public static void Highlight <TFont, TGlyph>( this IGlyphDisplay <TFont, TGlyph> self, Color color) where TFont : IFont <TGlyph> { self.TextColor = color; }