From 72844529206076feb7d6e12e7887b3b004847094 Mon Sep 17 00:00:00 2001
From: Jakob Voigts <jvoigts@mit.edu>
Date: Fri, 19 Feb 2016 13:08:32 -0500
Subject: [PATCH] now resizes more reliably

---
 Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp b/Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp
index debfa3385..ba94e505e 100644
--- a/Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp
+++ b/Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp
@@ -1854,6 +1854,7 @@ void LfpChannelDisplay::pxPaint()
         if (jto_wholechannel >= display->lfpChannelBitmap.getHeight()) {jto_wholechannel=display->lfpChannelBitmap.getHeight()-1;};
     
         // draw most recent drawn sample position
+        if (canvas->screenBufferIndex[chan]+1 <= display->lfpChannelBitmap.getWidth())
         for (int k=jfrom_wholechannel; k<=jto_wholechannel; k+=2) // draw line
             bdLfpChannelBitmap.setPixelColour(canvas->screenBufferIndex[chan]+1,k, Colours::yellow);
         
-- 
GitLab