aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2013-06-12 23:30:46 +0000
committerDimitri Sokolyuk <demon@dim13.org>2013-06-12 23:30:46 +0000
commit49775d3d3413d1e25541b7337148a143364a25e0 (patch)
tree883946a17ea186e71bb7e3d7d72786d8da9188d9
parentd1c54a3633dddc1a78dace9fe66135ffc1ecb8b9 (diff)
switch to library function (floor)
-rw-r--r--spectrogram.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/spectrogram.c b/spectrogram.c
index c3db19e..700a65a 100644
--- a/spectrogram.c
+++ b/spectrogram.c
@@ -165,12 +165,12 @@ draw(double *left, double *right, int p, int step)
sp_left.x, sp_left.y);
for (x = 0; x < wf_left.width; x++) {
- l = left[x] - 0.5;
- if (l >= p)
- l = p - 1;
- r = right[x] - 0.5;
- if (r >= p)
- r = p - 1;
+ l = floor(left[x]);
+ if (l > p)
+ l = p;
+ r = floor(right[x]);
+ if (r > p)
+ r = p;
lx = wf_left.x + wf_left.width - x - 1;
rx = wf_right.x + x;