Cleanup: remove duplication.
[dcpomatic.git] / src / wx / audio_mapping_view.cc
index 9c14f61e78f421bc54f867247daf62a2fd6ee27f..54b951df5aa995a50f5df3a27775d0095c867d7c 100644 (file)
@@ -280,6 +280,11 @@ AudioMappingView::paint_row_labels (wxDC& dc)
        }
        dc.DrawLine (wxPoint(MINIMUM_COLUMN_WIDTH, y), wxPoint(MINIMUM_COLUMN_WIDTH * 2, y));
 
+       if (_input_groups.empty()) {
+               auto const bottom = TOP_HEIGHT + _input_channels.size() * ROW_HEIGHT;
+               dc.DrawLine(wxPoint(MINIMUM_COLUMN_WIDTH, bottom), wxPoint(MINIMUM_COLUMN_WIDTH * 2, bottom));
+       }
+
        /* Group labels and lines; be careful here as wxDCClipper does not restore the old
         * clipping rectangle after it is destroyed
         */
@@ -314,16 +319,12 @@ AudioMappingView::paint_row_labels (wxDC& dc)
 void
 AudioMappingView::paint_row_lines (wxDC& dc)
 {
-       for (size_t i = 0; i < _input_channels.size(); ++i) {
+       for (size_t i = 0; i < _input_channels.size() + 1; ++i) {
                dc.DrawLine (
                        wxPoint(MINIMUM_COLUMN_WIDTH * 2, TOP_HEIGHT + ROW_HEIGHT * i),
                        wxPoint(LEFT_WIDTH + _column_widths_total, TOP_HEIGHT + ROW_HEIGHT * i)
                        );
        }
-       dc.DrawLine (
-               wxPoint(MINIMUM_COLUMN_WIDTH * 2, TOP_HEIGHT + ROW_HEIGHT * _input_channels.size()),
-               wxPoint(LEFT_WIDTH + _column_widths_total, TOP_HEIGHT + ROW_HEIGHT * _input_channels.size())
-               );
 }