Skip to content

Commit 575de13

Browse files
committed
Prevent freeze when channel height is less than 4
1 parent ddb8d7a commit 575de13

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

Plugins/LfpViewer/LfpChannelDisplay.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ void LfpChannelDisplay::pxPaint()
214214
if (showRangeMarkers)
215215
{
216216
int start = getY() + center - channelHeight / 2;
217-
int jump = channelHeight / 4;
217+
int jump = jmax (1, channelHeight / 4);
218218

219219
for (m = start; m <= start + jump * 4; m += jump)
220220
{
@@ -502,7 +502,7 @@ void LfpChannelDisplay::pxPaintHistory (int playhead, int rightEdge, int maxScre
502502
if (showRangeMarkers)
503503
{
504504
int start = getY() + center - channelHeight / 2;
505-
int jump = channelHeight / 4;
505+
int jump = jmax (1, channelHeight / 4);
506506

507507
for (m = start; m <= start + jump * 4; m += jump)
508508
{
@@ -705,12 +705,7 @@ void LfpChannelDisplay::paint (Graphics& g)
705705

706706
const int center = getHeight() / 2;
707707
const int start = center - channelHeight / 2;
708-
const int jump = channelHeight / 4;
709-
710-
if (jump <= 0)
711-
{
712-
return;
713-
}
708+
const int jump = jmax (1, channelHeight / 4);
714709

715710
const int labelWidth = 50;
716711
const int textHeight = 16;

0 commit comments

Comments
 (0)