File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1290
1290
}
1291
1291
1292
1292
// Make sure the to/from/len values are numbers.
1293
- from = parseFloat ( from ) ;
1294
- to = parseFloat ( to ) ;
1293
+ from = Math . min ( Math . max ( 0 , parseFloat ( from ) ) , 1 ) ;
1294
+ to = Math . min ( Math . max ( 0 , parseFloat ( to ) ) , 1 ) ;
1295
1295
len = parseFloat ( len ) ;
1296
1296
1297
1297
// Set the volume to the start position.
1354
1354
vol += diff * tick ;
1355
1355
1356
1356
// Make sure the volume is in the right bounds.
1357
- if ( diff < 0 ) {
1357
+ if ( diff < 0 ) {
1358
1358
vol = Math . max ( to , vol ) ;
1359
1359
} else {
1360
1360
vol = Math . min ( to , vol ) ;
1380
1380
clearInterval ( sound . _interval ) ;
1381
1381
sound . _interval = null ;
1382
1382
sound . _fadeTo = null ;
1383
- self . volume ( to , sound . _id ) ; //does this line has a sense now?
1383
+ self . volume ( to , sound . _id ) ;
1384
1384
self . _emit ( 'fade' , sound . _id ) ;
1385
1385
}
1386
1386
} , stepLen ) ;
You can’t perform that action at this time.
0 commit comments