Skip to content

Commit

Permalink
TriDelay display update
Browse files Browse the repository at this point in the history
Added clipping mask to the display.
  • Loading branch information
codygeary committed Nov 12, 2024
1 parent 1a15e3e commit 3dadd8a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/TriDelay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,14 @@ struct EnvDisplay : TransparentWidget {
centerY = box.size.y / 2.0f;
heightScale = centerY / 5; // Calculate based on current center Y

const float padding = 1.0f;
const float totalWidth = box.size.x - 2.0f * padding;
const float totalHeight = box.size.y - 2.0f * padding;

// Clip the drawing to the bounds of the widget
nvgScissor(args.vg, padding, padding, totalWidth, totalHeight);


drawWaveform(args, module->waveBuffers[0], nvgRGBAf(1, 0.4, 0, 0.8));
drawWaveform(args, module->waveBuffers[1], nvgRGBAf(0, 0.4, 1, 0.8));

Expand Down

0 comments on commit 3dadd8a

Please sign in to comment.