Index: trunk/parsers/wikidom/lib/es/es.Position.js |
— | — | @@ -43,9 +43,10 @@ |
44 | 44 | }; |
45 | 45 | |
46 | 46 | es.Position.prototype.near = function( position, range ) { |
47 | | - var x = this.left - position.left, |
48 | | - y = this.top - position.top; |
49 | | - return Math.sqrt( x * x, y * y ) <= range; |
| 47 | + return Math.sqrt( |
| 48 | + Math.pow( this.left - position.left, 2 ), |
| 49 | + Math.pow( this.top - position.top ) |
| 50 | + ) <= range; |
50 | 51 | }; |
51 | 52 | |
52 | 53 | es.Position.prototype.above = function( position ) { |