From 3b1decad392e4eb50d8875d19b5bf2e4170e1a40 Mon Sep 17 00:00:00 2001 From: VoidX Date: Sat, 12 Oct 2024 01:04:53 +0200 Subject: [PATCH] Dashed lines in overlays --- Cavern.QuickEQ/Graphing/Overlays/Frame.cs | 18 ++++++++++++++++++ .../Graphing/Overlays/LogScaleGrid.cs | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Cavern.QuickEQ/Graphing/Overlays/Frame.cs b/Cavern.QuickEQ/Graphing/Overlays/Frame.cs index a27d5bf0..21f35c20 100644 --- a/Cavern.QuickEQ/Graphing/Overlays/Frame.cs +++ b/Cavern.QuickEQ/Graphing/Overlays/Frame.cs @@ -65,5 +65,23 @@ protected void DrawColumn(GraphRenderer target, int offset, int width, uint colo width--; } } + + /// + /// Draw a single dashed column at a width of a developing image. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected void DrawDashedColumn(GraphRenderer target, int offset, int width, int dashLength, uint color) { + uint[] pixels = target.Pixels; + while (width > 0) { + for (int y = 0, pos = offset, step = target.Width; y < target.Height; y++) { + if (((y / dashLength) & 2) == 0) { + pixels[pos] = color; + } + pos += step; + } + offset++; + width--; + } + } } } \ No newline at end of file diff --git a/Cavern.QuickEQ/Graphing/Overlays/LogScaleGrid.cs b/Cavern.QuickEQ/Graphing/Overlays/LogScaleGrid.cs index 07de978e..47677951 100644 --- a/Cavern.QuickEQ/Graphing/Overlays/LogScaleGrid.cs +++ b/Cavern.QuickEQ/Graphing/Overlays/LogScaleGrid.cs @@ -9,7 +9,7 @@ public class LogScaleGrid : Frame { /// /// Inner line stroke width. /// - readonly int gridWidth; + protected readonly int gridWidth; /// /// Number of rows drawn, including the frame lines.