mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[apps/statistics] Reload CurveView before drawing histogram labels
This commit is contained in:
committed by
LeaNumworks
parent
a42208f773
commit
83722342f7
@@ -193,8 +193,6 @@ int CurveView::numberOfLabels(Axis axis) const {
|
||||
float minLabel = std::ceil(min(axis)/labelStep);
|
||||
float maxLabel = std::floor(max(axis)/labelStep);
|
||||
int numberOfLabels = maxLabel - minLabel + 1;
|
||||
// Assert labels are up to date
|
||||
assert(m_drawnRangeVersion == m_curveViewRange->rangeChecksum());
|
||||
assert(numberOfLabels <= (axis == Axis::Horizontal ? k_maxNumberOfXLabels : k_maxNumberOfYLabels));
|
||||
return numberOfLabels;
|
||||
}
|
||||
@@ -378,6 +376,9 @@ void CurveView::drawLabelsAndGraduations(KDContext * ctx, KDRect rect, Axis axis
|
||||
return;
|
||||
}
|
||||
|
||||
// Labels will be pulled. They must be up to date with current curve view.
|
||||
assert(m_drawnRangeVersion == m_curveViewRange->rangeChecksum());
|
||||
|
||||
// Draw the labels
|
||||
for (int i = minDrawnLabel; i < maxDrawnLabel; i++) {
|
||||
KDCoordinate labelPosition = std::round(floatToPixel(axis, labelValueAtIndex(axis, i)));
|
||||
|
||||
Reference in New Issue
Block a user