@@ -17,7 +17,7 @@ var constants = require('./constants');
17
17
18
18
var filteredPolygon = polygon . filter ;
19
19
var polygonTester = polygon . tester ;
20
- var MINDRAG = constants . MINDRAG ;
20
+ var MINSELECT = constants . MINSELECT ;
21
21
22
22
function getAxId ( ax ) { return ax . _id ; }
23
23
@@ -98,23 +98,23 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) {
98
98
dy = Math . abs ( y1 - y0 ) ;
99
99
100
100
if ( mode === 'select' ) {
101
- if ( dy < Math . min ( dx * 0.6 , MINDRAG ) ) {
101
+ if ( dy < Math . min ( dx * 0.6 , MINSELECT ) ) {
102
102
// horizontal motion: make a vertical box
103
103
poly = polygonTester ( [ [ x0 , 0 ] , [ x0 , ph ] , [ x1 , ph ] , [ x1 , 0 ] ] ) ;
104
104
// extras to guide users in keeping a straight selection
105
- corners . attr ( 'd' , 'M' + poly . xmin + ',' + ( y0 - MINDRAG ) +
106
- 'h-4v' + ( 2 * MINDRAG ) + 'h4Z' +
107
- 'M' + ( poly . xmax - 1 ) + ',' + ( y0 - MINDRAG ) +
108
- 'h4v' + ( 2 * MINDRAG ) + 'h-4Z' ) ;
105
+ corners . attr ( 'd' , 'M' + poly . xmin + ',' + ( y0 - MINSELECT ) +
106
+ 'h-4v' + ( 2 * MINSELECT ) + 'h4Z' +
107
+ 'M' + ( poly . xmax - 1 ) + ',' + ( y0 - MINSELECT ) +
108
+ 'h4v' + ( 2 * MINSELECT ) + 'h-4Z' ) ;
109
109
110
110
}
111
- else if ( dx < Math . min ( dy * 0.6 , MINDRAG ) ) {
111
+ else if ( dx < Math . min ( dy * 0.6 , MINSELECT ) ) {
112
112
// vertical motion: make a horizontal box
113
113
poly = polygonTester ( [ [ 0 , y0 ] , [ 0 , y1 ] , [ pw , y1 ] , [ pw , y0 ] ] ) ;
114
- corners . attr ( 'd' , 'M' + ( x0 - MINDRAG ) + ',' + poly . ymin +
115
- 'v-4h' + ( 2 * MINDRAG ) + 'v4Z' +
116
- 'M' + ( x0 - MINDRAG ) + ',' + ( poly . ymax - 1 ) +
117
- 'v4h' + ( 2 * MINDRAG ) + 'v-4Z' ) ;
114
+ corners . attr ( 'd' , 'M' + ( x0 - MINSELECT ) + ',' + poly . ymin +
115
+ 'v-4h' + ( 2 * MINSELECT ) + 'v4Z' +
116
+ 'M' + ( x0 - MINSELECT ) + ',' + ( poly . ymax - 1 ) +
117
+ 'v4h' + ( 2 * MINSELECT ) + 'v-4Z' ) ;
118
118
}
119
119
else {
120
120
// diagonal motion
0 commit comments