@@ -713,7 +713,8 @@ LfpDisplaySplitter::LfpDisplaySplitter (LfpDisplayNode* node,
713713 screenBufferWidth (0 ),
714714 nChans (0 ),
715715 selectedStreamId (0 ),
716- isSelected (false )
716+ isSelected (false ),
717+ hasAnyDepthInfo (false )
717718{
718719 viewport = std::make_unique<LfpViewport> (this );
719720 lfpDisplay = std::make_unique<LfpDisplay> (this , viewport.get ());
@@ -766,9 +767,12 @@ void LfpDisplaySplitter::refreshLeftMargin()
766767
767768 if (options->getChannelLabelDisplayMode () == LfpDisplayOptions::ChannelLabelDisplayMode::Depth)
768769 {
769- // If displaying depth, we want to ensure enough space for the largest possible depth label
770- const float textWidth = labelFont.getStringWidthFloat (" 99999 μm" );
771- newMargin = std::max (newMargin, static_cast <int > (std::ceil (textWidth)) + 10 );
770+ if (hasAnyDepthInfo)
771+ {
772+ // If displaying depth, we want to ensure enough space for the largest possible depth label
773+ const float textWidth = labelFont.getStringWidthFloat (" 99999 μm" );
774+ newMargin = std::max (newMargin, static_cast <int > (std::ceil (textWidth)) + 10 );
775+ }
772776 }
773777 else
774778 {
@@ -1008,6 +1012,10 @@ void LfpDisplaySplitter::updateSettings()
10081012 lfpDisplay->channels [i]->setName (displayBuffer->channelMetadata [i].name );
10091013 lfpDisplay->channels [i]->setGroup (displayBuffer->channelMetadata [i].group );
10101014 lfpDisplay->channels [i]->setDepth (displayBuffer->channelMetadata [i].ypos );
1015+ if (displayBuffer->channelMetadata [i].ypos != 0 )
1016+ {
1017+ hasAnyDepthInfo = true ;
1018+ }
10111019 lfpDisplay->channels [i]->setXpos (displayBuffer->channelMetadata [i].xpos );
10121020 lfpDisplay->channels [i]->setMetadataPresence (displayBuffer->channelMetadata [i].hasGroupMetadata ,
10131021 displayBuffer->channelMetadata [i].hasYposMetadata ,
0 commit comments