public void Draw(IGraphicsContext <TFont, TGlyph> context) { this.DrawBackground(context); context.SaveState(); context.DrawGlyphRunWithOffset(Run, Position, TextColor); context.RestoreState(); }
public void Draw(IGraphicsContext <TFont, TGlyph> context) { context.SaveState(); context.Translate(new PointF(Position.X, Position.Y - ShiftDown)); context.SetTextPosition(new PointF()); context.DrawGlyphsAtPoints(_glyphs, Font, _glyphPositions, TextColor); context.RestoreState(); }
public void Draw(IGraphicsContext <TFont, TGlyph> context) { context.SaveState(); var text = Run.Text; var font = Run.Font; context.DrawGlyphRunWithOffset(Run, Position, TextColor); context.RestoreState(); }
public void Draw(IGraphicsContext <TFont, TGlyph> context) { context.SaveState(); context.SetTextPosition(this.Position); foreach (var run in Runs) { run.Draw(context); } context.RestoreState(); }
public void Draw(IGraphicsContext <TFont, TGlyph> context) { context.SaveState(); PointF delta = new PointF(Position.X, Position.Y - ShiftDown); context.Translate(delta); context.SetTextPosition(new PointF()); context.DrawGlyphsAtPoints(_glyphs.AsForEach(), _mathFont, _glyphPositions.AsForEach(), TextColor); context.RestoreState(); }
public void Draw(IGraphicsContext <TFont, TGlyph> context) { context.SaveState(); TGlyph[] glyphArray = { Glyph }; PointF[] positions = { new PointF() }; context.Translate(new PointF(Position.X, Position.Y - ShiftDown)); context.SetTextPosition(new PointF()); context.DrawGlyphsAtPoints(glyphArray, Font, positions, TextColor); context.RestoreState(); }
public void Draw(IGraphicsContext <TFont, TGlyph> context) { this.DrawBackground(context); context.SaveState(); using var glyphs = new Structures.RentedArray <TGlyph>(Glyph); using var positions = new Structures.RentedArray <PointF>(new PointF()); context.Translate(new PointF(Position.X, Position.Y - ShiftDown)); context.SetTextPosition(new PointF()); context.DrawGlyphsAtPoints(glyphs.Result, Font, positions.Result, TextColor); context.RestoreState(); }
public static void DrawBackground <TFont, TGlyph> (this IDisplay <TFont, TGlyph> display, IGraphicsContext <TFont, TGlyph> context) where TFont : IFont <TGlyph> { if (display.BackColor is { } color) { context.SaveState(); context.FillRect(display.Frame(), color); context.RestoreState(); } }
public void Draw(IGraphicsContext <TFont, TGlyph> context) { context.SaveState(); context.Translate(this.Position); context.SetTextPosition(new PointF()); foreach (var displayAtom in Displays) { displayAtom.Draw(context); } context.RestoreState(); }
public void Draw(IGraphicsContext <TFont, TGlyph> context) { context.SaveState(); var glyphs = new RentedArray <TGlyph>(Glyph); var positions = new RentedArray <PointF>(new PointF()); context.Translate(new PointF(Position.X, Position.Y - ShiftDown)); context.SetTextPosition(new PointF()); context.DrawGlyphsAtPoints(glyphs.Result, Font, positions.Result, TextColor); context.RestoreState(); glyphs.Return(); positions.Return(); }