spek

Acoustic spectrum analyser
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

commit 3feb64543e97ca48c37c57aa81c94509fff0f549
parent 5ef71cbb9bcd9f4dff30b33ec7a3e348b01f29e2
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date:   Sun, 16 May 2010 19:38:54 +1000

Fix before-last tick placement

Diffstat:
Msrc/spek-spectrogram.vala | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/spek-spectrogram.vala b/src/spek-spectrogram.vala @@ -143,11 +143,12 @@ namespace Spek { int[] ticks = { 0, duration_seconds }; if (time_factor > 0) { for (var tick = time_factor; tick < duration_seconds; tick += time_factor) { + if (time_to_px (duration_seconds - tick, w, duration_seconds) < label_width) { + break; + } ticks += tick; } - // The last item should be skipped, it's too close to the end tick. // TODO: `ticks = ticks[0:-1]` crashes, file a bug. - ticks = ticks[0:ticks.length - 1]; } // Draw the ticks.