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

Function Subdivide

src/CellularPanel.cpp:1084–1108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1082
1083namespace {
1084 wxRect Subdivide(
1085 const wxRect &rect, bool divideX,
1086 const TrackPanelGroup::Refinement &children,
1087 const TrackPanelGroup::Refinement::const_iterator iter)
1088 {
1089 const auto next = iter + 1;
1090 const auto end = children.end();
1091 wxCoord nextCoord;
1092 if (next == end)
1093 nextCoord = std::max( iter->first,
1094 divideX ? rect.GetRight() : rect.GetBottom() );
1095 else
1096 nextCoord = next->first - 1;
1097
1098 auto lesser = iter->first;
1099 auto greater = nextCoord;
1100
1101 auto result = rect;
1102 if (divideX)
1103 result.SetLeft(lesser), result.SetRight(greater);
1104 else
1105 result.SetTop(lesser), result.SetBottom(greater);
1106
1107 return result;
1108 };
1109}
1110
1111// Private, recursive implementation function of Visit

Callers 2

VisitMethod · 0.85
FindCellMethod · 0.85

Calls 3

maxFunction · 0.85
GetRightMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected