| 972 | } |
| 973 | |
| 974 | void TrackPanel::UpdateTrackVRuler(Track &t) |
| 975 | { |
| 976 | auto heights = FindAdjustedChannelHeights(t); |
| 977 | |
| 978 | wxRect rect(mViewInfo->GetVRulerOffset(), |
| 979 | 0, |
| 980 | mViewInfo->GetVRulerWidth(), |
| 981 | 0); |
| 982 | |
| 983 | auto pHeight = heights.begin(); |
| 984 | for (auto pChannel : t.Channels()) { |
| 985 | auto &view = ChannelView::Get(*pChannel); |
| 986 | const auto height = *pHeight++; |
| 987 | rect.SetHeight(height); |
| 988 | const auto subViews = view.GetSubViews(rect); |
| 989 | if (subViews.empty()) |
| 990 | continue; |
| 991 | |
| 992 | auto iter = subViews.begin(), end = subViews.end(), next = iter; |
| 993 | auto yy = iter->first; |
| 994 | wxSize vRulerSize{ 0, 0 }; |
| 995 | auto &size = view.vrulerSize; |
| 996 | for (; iter != end; iter = next) { |
| 997 | ++next; |
| 998 | auto nextY = (next == end) |
| 999 | ? height |
| 1000 | : next->first; |
| 1001 | rect.SetHeight(nextY - yy); |
| 1002 | // This causes ruler size in the track to be reassigned: |
| 1003 | ChannelVRulerControls::Get(*iter->second).UpdateRuler(rect); |
| 1004 | // But we want to know the maximum width and height over all sub-views: |
| 1005 | vRulerSize.IncTo({ size.first, size.second }); |
| 1006 | yy = nextY; |
| 1007 | } |
| 1008 | size = { vRulerSize.x, vRulerSize.y }; |
| 1009 | } |
| 1010 | } |
| 1011 | |
| 1012 | void TrackPanel::UpdateVRulerSize() |
| 1013 | { |
nothing calls this directly
no test coverage detected