diff options
author | Rory Hardy <rory.cronin-hardy@cerner.com> | 2013-08-07 22:40:07 -0500 |
---|---|---|
committer | Rory Hardy <rory.cronin-hardy@cerner.com> | 2013-08-07 22:40:07 -0500 |
commit | b2c6ccc91205ef1b6e2a6ddc720458af443f0b84 (patch) | |
tree | 4df312f5459e0c56dcd91ed293b6d36e40a5211d /plugin | |
parent | 0a78486b22ff904c6bf5c54efcb726da38974cdd (diff) | |
download | fosdem-2018-presentation-b2c6ccc91205ef1b6e2a6ddc720458af443f0b84.tar fosdem-2018-presentation-b2c6ccc91205ef1b6e2a6ddc720458af443f0b84.tar.gz |
Minor update
Made sure all vars are declared with the var keyword.
modified: plugin/leap/leap.js
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/leap/leap.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/plugin/leap/leap.js b/plugin/leap/leap.js index b2f91de..8ba0063 100644 --- a/plugin/leap/leap.js +++ b/plugin/leap/leap.js @@ -37,8 +37,7 @@ var b=right.criteria;if(a!==b){if(a>b||a===void 0)return 1;if(a<b||b===void 0)re pointerSize : 15, // Default minimum height/width of the pointer. pointerTolerance : 120 // Bigger = slower pointer. }, - now, - entered; + entered, enteredPosition, now, size, tipPosition; // Other vars we need later, but don't need to redeclare. // Merge user defined settings with defaults if( leapConfig ) { @@ -63,7 +62,7 @@ var b=right.criteria;if(a!==b){if(a>b||a===void 0)return 1;if(a<b||b===void 0)re // The innaccuracies were observed on a development model and may not be an issue with consumer models. if( frame.fingers.length > 0 && frame.fingers.length < 3 ) { // Invert direction and multiply by 3 for greater effect. - var size = -3 * frame.fingers[0].tipPosition[2]; + size = -3 * frame.fingers[0].tipPosition[2]; if( size < config.pointerSize ) { size = config.pointerSize; @@ -74,9 +73,9 @@ var b=right.criteria;if(a!==b){if(a>b||a===void 0)return 1;if(a<b||b===void 0)re pointer.style.borderRadius = size - 5 + 'px'; pointer.style.visibility = 'visible'; - tipPosition = frame.fingers[0].tipPosition; - if( config.autoCenter ) { + tipPosition = frame.fingers[0].tipPosition; + // Check whether the finger has entered the z range of the Leap Motion. Used for the autoCenter option. if( !entered ) { entered = true; |