| 783 | } |
| 784 | |
| 785 | void TrackPanel::RefreshTrack(Track *trk, bool refreshbacking) |
| 786 | { |
| 787 | if (!trk) |
| 788 | return; |
| 789 | |
| 790 | auto height = ChannelView::GetChannelGroupHeight(trk); |
| 791 | |
| 792 | // Set rectangle top according to the scrolling position, `vpos` |
| 793 | // Subtract the inset (above) and shadow (below) from the height of the |
| 794 | // rectangle, but not the border |
| 795 | // This matters because some separators do paint over the border |
| 796 | auto &view = ChannelView::Get(*trk->GetChannel(0)); |
| 797 | const auto top = |
| 798 | -mViewInfo->vpos + view.GetCumulativeHeightBefore() + kTopInset; |
| 799 | height -= (kTopInset + kShadowThickness); |
| 800 | |
| 801 | // Width also subtracts insets (left and right) plus shadow (right) |
| 802 | const auto left = kLeftInset; |
| 803 | const auto width = GetRect().GetWidth() |
| 804 | - (kLeftInset + kRightInset + kShadowThickness); |
| 805 | |
| 806 | wxRect rect(left, top, width, height); |
| 807 | |
| 808 | if( refreshbacking ) |
| 809 | mRefreshBacking = true; |
| 810 | |
| 811 | Refresh( false, &rect ); |
| 812 | } |
| 813 | |
| 814 | |
| 815 | /// This method overrides Refresh() of wxWindow so that the |
no test coverage detected