osc: apply widget's precision at send time
This commit is contained in:
parent
549e8ea223
commit
557cf4620a
1 changed files with 2 additions and 2 deletions
|
|
@ -32,7 +32,7 @@ var parseArg = function(arg,precision){
|
|||
if (arg==null) return null
|
||||
switch (typeof arg) {
|
||||
case 'number':
|
||||
return {type: precision == 0 ? 'i' : 'f', value: arg}
|
||||
return {type: precision == 0 ? 'i' : 'f', value: parseFloat(arg.toFixed(Math.min(precision,20)))}
|
||||
case 'boolean':
|
||||
return {type: arg ? 'T' : 'F', value: arg}
|
||||
case 'object':
|
||||
|
|
@ -104,7 +104,7 @@ var oscOutFilter = function(data){
|
|||
var oscInHandler = function(msg, timetag, info){
|
||||
var data = oscInFilter({address: msg.address, args: msg.args, host: info.address, port: info.port})
|
||||
for (i in data.args) {
|
||||
data.args[i] = data.args[i].value
|
||||
data.args[i] = data.args[i].value
|
||||
}
|
||||
receiveOsc(data)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue