diff layer/LinearNumericalScale.cpp @ 1260:cdaeff1858af scale-ticks

Make use of ScaleTickIntervals in log scale as well
author Chris Cannam
date Thu, 04 May 2017 15:42:40 +0100
parents 4d7e566092a7
children a34a2a25907c
line wrap: on
line diff
--- a/layer/LinearNumericalScale.cpp	Thu May 04 15:37:43 2017 +0100
+++ b/layer/LinearNumericalScale.cpp	Thu May 04 15:42:40 2017 +0100
@@ -40,14 +40,14 @@
 				    double maxf)
 {
     int n = 10;
-
     auto ticks = ScaleTickIntervals::linear({ minf, maxf, n });
+    n = int(ticks.size());
 
     int w = getWidth(v, paint) + x0;
 
     int prevy = -1;
-                
-    for (int i = 0; i < int(ticks.size()); ++i) {
+
+    for (int i = 0; i < n; ++i) {
 
 	int y, ty;
         bool drawText = true;