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; }
/// <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));
/// <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));
/// <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));