示例#1
0
 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();
 }
示例#3
0
        public void Draw(IGraphicsContext <TFont, TGlyph> context)
        {
            context.SaveState();
            var text = Run.Text;
            var font = Run.Font;

            context.DrawGlyphRunWithOffset(Run, Position, TextColor);
            context.RestoreState();
        }
示例#4
0
 public void Draw(IGraphicsContext <TFont, TGlyph> context)
 {
     context.SaveState();
     context.SetTextPosition(this.Position);
     foreach (var run in Runs)
     {
         run.Draw(context);
     }
     context.RestoreState();
 }
示例#5
0
        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();
        }
示例#6
0
 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();
 }
示例#7
0
 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();
 }
示例#8
0
 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();
     }
 }
示例#9
0
 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();
 }
示例#10
0
        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();
        }