From 49e7ad857203ff6649d986727a0477b541e463d0 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 22 Mar 2016 17:44:18 +0100 Subject: [PATCH] fix visualizer osc value plot timing --- browser/js/app/widgets/visualizer.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/browser/js/app/widgets/visualizer.js b/browser/js/app/widgets/visualizer.js index e1213af0..910607ff 100644 --- a/browser/js/app/widgets/visualizer.js +++ b/browser/js/app/widgets/visualizer.js @@ -48,6 +48,7 @@ module.exports.create = function(widgetData,container) { } widget.length = Math.round(clip(60*widgetData.duration,[8,4096])) widget.data = new Array(widget.length) + widget.value = widgetData.range.min canvas.resize(function(){ var width = canvas.width(), @@ -156,9 +157,11 @@ module.exports.create = function(widgetData,container) { var id = widgetData.widgetId if (typeof id == 'string' && WIDGETS[id]) { - widget.data.push(WIDGETS[id][WIDGETS[id].length-1].getValue()) + var v = WIDGETS[id][WIDGETS[id].length-1].getValue() + widget.data.push(v) + widget.value = v } else { - widget.data.push(widget.data[widget.data.length-1]) + widget.data.push(widget.value) } widget.data.splice(0,1) @@ -166,8 +169,7 @@ module.exports.create = function(widgetData,container) { } widget.setValue = function(v) { - widget.data.push(v) - widget.data.splice(0,1) + widget.value = v widget.startLoop() }