@@ -646,11 +646,14 @@ bool WaveformArea::Render(int iArea, int numAreas, ImVec2 clientArea)
646646
647647 ImGui::PushID (to_string (iArea).c_str ());
648648
649- float totalHeightAvailable = floor (clientArea.y - ImGui::GetFrameHeightWithSpacing ());
650- totalHeightAvailable -= 5 ; // fudge factor, need to figure out root cause
649+ float totalHeightAvailable = floor (clientArea.y - 2 *ImGui::GetFrameHeightWithSpacing ());
651650 float spacing = m_group->GetSpacing ();
652651 float heightPerArea = totalHeightAvailable / numAreas;
653- float unspacedHeightPerArea = floor (heightPerArea - spacing);
652+ float totalSpacing = (numAreas-1 )*spacing;
653+ float unspacedHeightPerArea = floor ( (totalHeightAvailable - totalSpacing) / numAreas);
654+ unspacedHeightPerArea -= ImGui::GetStyle ().FramePadding .y ;
655+ if (numAreas == 1 )
656+ unspacedHeightPerArea = heightPerArea;
654657
655658 // Update cached scale
656659 m_height = unspacedHeightPerArea;
@@ -746,14 +749,19 @@ bool WaveformArea::Render(int iArea, int numAreas, ImVec2 clientArea)
746749 RenderYAxis (ImVec2 (yAxisWidth, unspacedHeightPerArea), gridmap, vbot, vtop);
747750
748751 // Render the Y axis cursors (if we have any) over the top of everything else
749- auto oldpos = ImGui::GetCursorPos ();
750752 {
751753 auto csize = ImGui::GetContentRegionAvail ();
752754 auto pos = ImGui::GetWindowPos ();
753755 ImGui::SetCursorPos (cpos);
754756 RenderYAxisCursors (pos, csize, yAxisWidth);
755757 }
756- ImGui::SetCursorPos (oldpos);
758+
759+ // Cursor should now be at end of window
760+ ImGui::SetCursorPos (ImVec2 (cpos.x , cpos.y + unspacedHeightPerArea));
761+
762+ // Add spacing
763+ if (iArea != numAreas-1 )
764+ ImGui::Dummy (ImVec2 (0 , spacing));
757765
758766 ImGui::PopID ();
759767
0 commit comments