mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[apps/shared] Handle null labelStep in numberOfLabels
This commit is contained in:
committed by
LeaNumworks
parent
9f0c7a87fd
commit
a42208f773
@@ -187,6 +187,9 @@ float CurveView::gridUnit(Axis axis) const {
|
||||
|
||||
int CurveView::numberOfLabels(Axis axis) const {
|
||||
float labelStep = 2.0f * gridUnit(axis);
|
||||
if (labelStep <= 0.0f) {
|
||||
return 0;
|
||||
}
|
||||
float minLabel = std::ceil(min(axis)/labelStep);
|
||||
float maxLabel = std::floor(max(axis)/labelStep);
|
||||
int numberOfLabels = maxLabel - minLabel + 1;
|
||||
|
||||
Reference in New Issue
Block a user