Skip to content

Commit

Permalink
Dashed lines in overlays
Browse files Browse the repository at this point in the history
  • Loading branch information
VoidXH committed Oct 11, 2024
1 parent adb28a1 commit 3b1deca
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions Cavern.QuickEQ/Graphing/Overlays/Frame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,23 @@ protected void DrawColumn(GraphRenderer target, int offset, int width, uint colo
width--;
}
}

/// <summary>
/// Draw a single dashed column at a width <paramref name="offset"/> of a developing image.
/// </summary>
[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--;
}
}
}
}
2 changes: 1 addition & 1 deletion Cavern.QuickEQ/Graphing/Overlays/LogScaleGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class LogScaleGrid : Frame {
/// <summary>
/// Inner line stroke width.
/// </summary>
readonly int gridWidth;
protected readonly int gridWidth;

/// <summary>
/// Number of rows drawn, including the frame lines.
Expand Down

0 comments on commit 3b1deca

Please sign in to comment.