Skip to content

Commit bc93224

Browse files
committed
Adjust alpha transparency in event overlay based on channel height
1 parent 1973dc0 commit bc93224

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Plugins/LfpViewer/LfpChannelDisplay.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ String formatRangeMarkerValue (float value)
5252

5353
const float magnitude = std::abs (value);
5454
const int decimals = magnitude >= 100.0f ? 0 : magnitude >= 10.0f ? 1
55-
: 2;
55+
: 2;
5656

5757
return String (value, decimals);
5858
}
@@ -686,11 +686,12 @@ void LfpChannelDisplay::pxPaintHistory (int playhead, int rightEdge, int maxScre
686686

687687
void LfpChannelDisplay::drawEventOverlay (const int rawEventState, int x, int yfrom, int yto, Graphics& g)
688688
{
689+
float alpha = channelHeight > 5 ? 0.3f : 0.5f;
689690
for (int ev_ch = 0; ev_ch < 8; ev_ch++)
690691
{
691692
if (display->getEventDisplayState (ev_ch) && (rawEventState & (1 << ev_ch)))
692693
{
693-
g.setColour (display->channelColours[ev_ch * 2].withAlpha (0.5f));
694+
g.setColour (display->channelColours[ev_ch * 2].withAlpha (alpha));
694695
g.fillRect (x, yfrom, 1, yto - yfrom + 1);
695696
}
696697
}

0 commit comments

Comments
 (0)