MCPcopy Create free account
hub / github.com/audacity/audacity / UpdateTrackVRuler

Method UpdateTrackVRuler

src/TrackPanel.cpp:974–1010  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

972}
973
974void 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
1012void TrackPanel::UpdateVRulerSize()
1013{

Callers

nothing calls this directly

Calls 8

GetFunction · 0.85
ChannelsMethod · 0.80
beginMethod · 0.45
GetSubViewsMethod · 0.45
emptyMethod · 0.45
endMethod · 0.45
UpdateRulerMethod · 0.45

Tested by

no test coverage detected