v8: fix some js optimization with the arguments object
This commit is contained in:
parent
677d67f8e3
commit
cfe0fe994f
4 changed files with 4 additions and 4 deletions
|
|
@ -218,7 +218,7 @@ module.exports = class MultiXy extends _pads_base {
|
|||
setValue(v, options={}) {
|
||||
|
||||
if (!v || !v.length || v.length!=this.npoints * 2) return
|
||||
if (this.touched && !options.dragged) return this.setValueTouchedQueue = arguments
|
||||
if (this.touched && !options.dragged) return this.setValueTouchedQueue = [v, options]
|
||||
|
||||
for (var i=0;i<this.npoints;i++) {
|
||||
if (!options.dragged) {
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ module.exports = class Rgb extends _pads_base {
|
|||
setValue(v, options={}) {
|
||||
|
||||
if (!v || !v.length || v.length!=3) return
|
||||
if (this.touched && !options.dragged) return this.setValueTouchedQueue = arguments
|
||||
if (this.touched && !options.dragged) return this.setValueTouchedQueue = [v, options]
|
||||
|
||||
for (let i in [0,1,2]) {
|
||||
v[i] = clip(v[i],[0,255])
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ module.exports = class Xy extends _pads_base {
|
|||
setValue(v, options={}) {
|
||||
|
||||
if (!v || !v.length || v.length!=2) return
|
||||
if (this.touched && !options.dragged) return this.setValueTouchedQueue = arguments
|
||||
if (this.touched && !options.dragged) return this.setValueTouchedQueue = [v, options]
|
||||
|
||||
if (!options.dragged) {
|
||||
this.faders.x.setValue(v[0], {sync: false, send:false, dragged:false})
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ module.exports = class _sliders_base extends _canvas_base {
|
|||
setValue(v,options={}) {
|
||||
|
||||
if (typeof v != 'number') return
|
||||
if (this.touched && !options.dragged) return this.setValueTouchedQueue = arguments
|
||||
if (this.touched && !options.dragged) return this.setValueTouchedQueue = [v, options]
|
||||
|
||||
var value = clip(v,[this.rangeValsMin,this.rangeValsMax])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue