fixed broken second marks, added 10s marks

This commit is contained in:
2016-04-02 19:59:12 +02:00
parent 075c525b64
commit 30a5479d13
4 changed files with 16 additions and 8 deletions
+11 -3
View File
@@ -27,6 +27,7 @@ var page_spectrogram = (function () {
var lastLoadMs;
var lastMarkMs;
var lastMark10s;
var colormap = [
/* [val, r, g, b] */
@@ -126,13 +127,19 @@ var page_spectrogram = (function () {
if (msElapsed(lastMarkMs) >= 950) {
lastMarkMs = msNow();
var long = false;
if (msElapsed(lastMark10s) > 9500) {
long = true;
lastMark10s = msNow();
}
ctx.strokeStyle = 'white';
ctx.beginPath();
ctx.moveTo(plot.x+plot.w-.5, plot.y+plot.h+.5);
ctx.lineTo(plot.x+plot.w-.5, plot.y+plot.h+4);
ctx.moveTo(plot.x+plot.w-.5, plot.y+plot.h+1);
ctx.lineTo(plot.x+plot.w-.5, plot.y+plot.h+1+(long?6:2));
ctx.stroke();
} else {
ctx.clearRect(plot.x+plot.w-2, plot.y+plot.h+1,2,4);
ctx.clearRect(plot.x+plot.w-1, plot.y+plot.h+1,2,10);
}
}
@@ -318,6 +325,7 @@ var page_spectrogram = (function () {
drawLegend();
drawAxis();
lastMarkMs = msNow()-10000;
lastMark10s = msNow()-10000;
// update tile size on bin count selection
$('#count').on('change', function() {