Mercurial > hg > svgui
comparison 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 |
comparison
equal
deleted
inserted
replaced
1259:4d7e566092a7 | 1260:cdaeff1858af |
---|---|
38 int x0, | 38 int x0, |
39 double minf, | 39 double minf, |
40 double maxf) | 40 double maxf) |
41 { | 41 { |
42 int n = 10; | 42 int n = 10; |
43 | |
44 auto ticks = ScaleTickIntervals::linear({ minf, maxf, n }); | 43 auto ticks = ScaleTickIntervals::linear({ minf, maxf, n }); |
44 n = int(ticks.size()); | |
45 | 45 |
46 int w = getWidth(v, paint) + x0; | 46 int w = getWidth(v, paint) + x0; |
47 | 47 |
48 int prevy = -1; | 48 int prevy = -1; |
49 | 49 |
50 for (int i = 0; i < int(ticks.size()); ++i) { | 50 for (int i = 0; i < n; ++i) { |
51 | 51 |
52 int y, ty; | 52 int y, ty; |
53 bool drawText = true; | 53 bool drawText = true; |
54 | 54 |
55 if (i == n-1 && | 55 if (i == n-1 && |