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) {
4949 var isRect = false ,
5050 rectFirstEdgeTest ;
5151
52- function onFirstVert ( pt ) { return pt [ 0 ] === pts [ 0 ] [ 0 ] ; }
53- function onFirstHorz ( pt ) { return pt [ 1 ] === pts [ 0 ] [ 1 ] ; }
54-
5552 if ( pts . length === 5 ) {
5653 if ( pts [ 0 ] [ 0 ] === pts [ 1 ] [ 0 ] ) { // vert, horz, vert, horz
5754 if ( pts [ 2 ] [ 0 ] === pts [ 3 ] [ 0 ] &&
5855 pts [ 0 ] [ 1 ] === pts [ 3 ] [ 1 ] &&
5956 pts [ 1 ] [ 1 ] === pts [ 2 ] [ 1 ] ) {
6057 isRect = true ;
61- rectFirstEdgeTest = onFirstVert ;
58+ rectFirstEdgeTest = function ( pt ) { return pt [ 0 ] === pts [ 0 ] [ 0 ] ; } ;
6259 }
6360 }
6461 else if ( pts [ 0 ] [ 1 ] === pts [ 1 ] [ 1 ] ) { // horz, vert, horz, vert
6562 if ( pts [ 2 ] [ 1 ] === pts [ 3 ] [ 1 ] &&
6663 pts [ 0 ] [ 0 ] === pts [ 3 ] [ 0 ] &&
6764 pts [ 1 ] [ 0 ] === pts [ 2 ] [ 0 ] ) {
6865 isRect = true ;
69- rectFirstEdgeTest = onFirstHorz ;
66+ rectFirstEdgeTest = function ( pt ) { return pt [ 1 ] === pts [ 0 ] [ 1 ] ; } ;
7067 }
7168 }
7269 }
You can’t perform that action at this time.
0 commit comments