sanitize visualizer data length
This commit is contained in:
parent
c2e1b4b179
commit
cbb6ffcfd2
1 changed files with 3 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
|||
var utils = require('./utils'),
|
||||
mapToScale = utils.mapToScale
|
||||
mapToScale = utils.mapToScale,
|
||||
clip = utils.clip
|
||||
|
||||
module.exports.options = {
|
||||
type:'visualizer',
|
||||
|
|
@ -44,7 +45,7 @@ module.exports.create = function(widgetData,container) {
|
|||
min: Math.abs(widgetData.range.min)>=1000?widgetData.range.min/1000+'k':widgetData.range.min,
|
||||
max: Math.abs(widgetData.range.max)>=1000?widgetData.range.max/1000+'k':widgetData.range.max
|
||||
}
|
||||
widget.length = 60*widgetData.duration
|
||||
widget.length = Math.round(clip(60*widgetData.duration,[8,4096]))
|
||||
widget.data = new Array(widget.length)
|
||||
|
||||
canvas.resize(function(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue