File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -49,24 +49,21 @@ polygon.tester = function tester(ptsIn) {
49
49
var isRect = false ,
50
50
rectFirstEdgeTest ;
51
51
52
- function onFirstVert ( pt ) { return pt [ 0 ] === pts [ 0 ] [ 0 ] ; }
53
- function onFirstHorz ( pt ) { return pt [ 1 ] === pts [ 0 ] [ 1 ] ; }
54
-
55
52
if ( pts . length === 5 ) {
56
53
if ( pts [ 0 ] [ 0 ] === pts [ 1 ] [ 0 ] ) { // vert, horz, vert, horz
57
54
if ( pts [ 2 ] [ 0 ] === pts [ 3 ] [ 0 ] &&
58
55
pts [ 0 ] [ 1 ] === pts [ 3 ] [ 1 ] &&
59
56
pts [ 1 ] [ 1 ] === pts [ 2 ] [ 1 ] ) {
60
57
isRect = true ;
61
- rectFirstEdgeTest = onFirstVert ;
58
+ rectFirstEdgeTest = function ( pt ) { return pt [ 0 ] === pts [ 0 ] [ 0 ] ; } ;
62
59
}
63
60
}
64
61
else if ( pts [ 0 ] [ 1 ] === pts [ 1 ] [ 1 ] ) { // horz, vert, horz, vert
65
62
if ( pts [ 2 ] [ 1 ] === pts [ 3 ] [ 1 ] &&
66
63
pts [ 0 ] [ 0 ] === pts [ 3 ] [ 0 ] &&
67
64
pts [ 1 ] [ 0 ] === pts [ 2 ] [ 0 ] ) {
68
65
isRect = true ;
69
- rectFirstEdgeTest = onFirstHorz ;
66
+ rectFirstEdgeTest = function ( pt ) { return pt [ 1 ] === pts [ 0 ] [ 1 ] ; } ;
70
67
}
71
68
}
72
69
}
You can’t perform that action at this time.
0 commit comments