예제 #1
0
        private static void DrawDisplay(MathPainter settings, Display.IDisplay <Fonts, Glyph> display,
                                        System.Action <MathPainter> draw)
        {
            if (display is null)
            {
                return;
            }
            var original = (settings._display, settings._displayChanged);

            (settings._display, settings._displayChanged) = (display, false);
            draw(settings);
            (settings._display, settings._displayChanged) = original;
        }
예제 #2
0
 /// <summary>
 /// Ignores the MathList and LaTeX of the <see cref="MathPainter"/> provided.
 /// Repositions the <paramref name="display"/>.
 /// </summary>
 public static void DrawDisplay(MathPainter settings, Display.IDisplay <Fonts, Glyph> display,
                                SKCanvas canvas, float x, float y) =>
 DrawDisplay(settings, display, _ => _.Draw(canvas, x, y));
예제 #3
0
 /// <summary>
 /// Ignores the MathList and LaTeX of the <see cref="MathPainter"/> provided.
 /// Repositions the <paramref name="display"/>.
 /// </summary>
 public static void DrawDisplay(MathPainter settings, Display.IDisplay <Fonts, Glyph> display,
                                SKCanvas canvas, TextAlignment textAlignment = TextAlignment.Center,
                                Thickness padding = default, float offsetX = 0, float offsetY = 0) =>
 DrawDisplay(settings, display, _ =>
             _.Draw(canvas, textAlignment, padding, offsetX, offsetY));
예제 #4
0
 /// <summary>
 /// Ignores the MathList and LaTeX of the <see cref="MathPainter"/> provided.
 /// Repositions the <paramref name="display"/>.
 /// </summary>
 public static void DrawDisplay(MathPainter settings, Display.IDisplay <Fonts, Glyph> display,
                                SKCanvas canvas, SKPoint position) =>
 DrawDisplay(settings, display, _ => _.Draw(canvas, position));