@@ -215,6 +215,8 @@ void LfpDisplayCanvas::update()
215215 displayBufferIndex.clear ();
216216
217217 options->setEnabled (nChans != 0 );
218+ // must manually ensure that overlapSelection propagates up to canvas
219+ channelOverlapFactor = options->selectedOverlapValue .getFloatValue ();
218220
219221 for (int i = 0 ; i <= nChans; i++) // extra channel for events
220222 {
@@ -248,7 +250,6 @@ void LfpDisplayCanvas::update()
248250
249251 if (nChans != lfpDisplay->getNumChannels ())
250252 {
251- // std::cout << "Setting num inputs on LfpDisplayCanvas to " << nChans << std::endl;
252253
253254 refreshScreenBuffer ();
254255
@@ -260,17 +261,16 @@ void LfpDisplayCanvas::update()
260261
261262 String chName = processor->getDataChannel (i)->getName ();
262263
263- // std::cout << chName << std::endl;
264-
265264 lfpDisplay->channelInfo [i]->setName (chName);
266265 lfpDisplay->setEnabledState (isChannelEnabled[i], i);
267266
268267 }
269268
270- if (nChans > 0 )
271- lfpDisplay->setBounds (0 ,0 ,getWidth ()-scrollBarThickness*2 , lfpDisplay->getTotalHeight ());
272- else
273- lfpDisplay->setBounds (0 , 0 , getWidth (), getHeight ());
269+ if (nChans == 0 ) lfpDisplay->setBounds (0 , 0 , getWidth (), getHeight ());
270+ else {
271+ lfpDisplay->rebuildDrawableChannelsList ();
272+ lfpDisplay->setBounds (0 , 0 , getWidth ()-scrollBarThickness*2 , lfpDisplay->getTotalHeight ());
273+ }
274274
275275 resized ();
276276 }
@@ -282,10 +282,10 @@ void LfpDisplayCanvas::update()
282282 lfpDisplay->channelInfo [i]->updateType ();
283283 }
284284
285+ if (nChans > 0 )
286+ lfpDisplay->rebuildDrawableChannelsList ();
285287 }
286288
287- if (nChans > 0 )
288- lfpDisplay->rebuildDrawableChannelsList ();
289289
290290}
291291
@@ -656,9 +656,9 @@ void LfpDisplayCanvas::paint(Graphics& g)
656656 for (int i = 0 ; i < 10 ; i++)
657657 {
658658 if (i == 5 || i == 0 )
659- g.drawLine (w/10 *i+leftmargin,0 ,w/10 *i+leftmargin,getHeight ()-60 ,3 .0f );
659+ g.drawLine (w/10 *i+leftmargin,timescale-> getHeight () ,w/10 *i+leftmargin,getHeight ()-60 -timescale-> getHeight () ,3 .0f );
660660 else
661- g.drawLine (w/10 *i+leftmargin,0 ,w/10 *i+leftmargin,getHeight ()-60 ,1 .0f );
661+ g.drawLine (w/10 *i+leftmargin,timescale-> getHeight () ,w/10 *i+leftmargin,getHeight ()-60 -timescale-> getHeight () ,1 .0f );
662662 }
663663
664664 g.drawLine (0 ,getHeight ()-60 ,getWidth (),getHeight ()-60 ,3 .0f );
@@ -2278,7 +2278,7 @@ void LfpDisplay::setNumChannels(int numChannels)
22782278 setColors ();
22792279
22802280
2281- // std::cout << "TOTAL HEIGHT = " << totalHeight << std::endl;
2281+ std::cout << " TOTAL HEIGHT = " << totalHeight << std::endl;
22822282
22832283}
22842284
@@ -2345,11 +2345,9 @@ void LfpDisplay::resized()
23452345 LfpChannelDisplayInfo* info = drawableChannels[i].channelInfo ;
23462346
23472347 info->setBounds (0 ,
2348- // totalHeight-disp->getChannelHeight()/4,
23492348 totalHeight-disp->getChannelHeight () + (disp->getChannelOverlap ()*canvas->channelOverlapFactor )/4.0 ,
23502349 canvas->leftmargin + 50 ,
23512350 disp->getChannelHeight ());
2352- // disp->getChannelHeight()+(disp->getChannelOverlap()*canvas->channelOverlapFactor));
23532351
23542352 totalHeight += disp->getChannelHeight ();
23552353
0 commit comments