From 13ae16997d4bbca14e255d5989d1c44a76eac72c Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 16 May 2012 15:23:48 -0700 Subject: montage v.0.10 integration Signed-off-by: Valerio Virgillito --- .../ui/nearest-neighbor-component-search.js | 122 ++++++++++----------- 1 file changed, 61 insertions(+), 61 deletions(-) (limited to 'node_modules/montage/ui/nearest-neighbor-component-search.js') diff --git a/node_modules/montage/ui/nearest-neighbor-component-search.js b/node_modules/montage/ui/nearest-neighbor-component-search.js index 6ba155ea..8cc9e4c2 100644 --- a/node_modules/montage/ui/nearest-neighbor-component-search.js +++ b/node_modules/montage/ui/nearest-neighbor-component-search.js @@ -25,23 +25,23 @@ var NearestNeighborComponentSearch = exports.NearestNeighborComponentSearch = Mo }, _pointerPosition: { - enumerable: false, + enumerable: false, value: null }, - pointerPosition: { - get: function () { - return this._pointerPosition; - }, - set: function (value) { - var nearest = null; + pointerPosition: { + get: function () { + return this._pointerPosition; + }, + set: function (value) { + var nearest = null; this._pointerPosition=value; if ((this._componentList)&&(this._componentList.length)) { var target = value.target, nearest; - for (i=0; i1e-10) { - u=q[i+1]*a-q[i]*b; - if (u<0) { - x=q[i]; - y=q[i+1]; - } else if (u>div) { - x=q[i]+b; - y=q[i+1]-a; - } else { - u/=div; - x=q[i]+u*b; - y=q[i+1]-u*a; - } - iDist=x*x+y*y; - if (iDist1e-10) { + u=q[i+1]*a-q[i]*b; + if (u<0) { + x=q[i]; + y=q[i+1]; + } else if (u>div) { + x=q[i]+b; + y=q[i+1]-a; + } else { + u/=div; + x=q[i]+u*b; + y=q[i+1]-u*a; + } + iDist=x*x+y*y; + if (iDist