File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import { SlideData } from '../../gestures/slide-gesture';
4
4
import { assign } from '../../util/util' ;
5
5
import { GestureDelegate , GesturePriority } from '../../gestures/gesture-controller' ;
6
6
7
+ const DEGRESS_TO_RADIANS = Math . PI / 180 ;
8
+ const MIN_COSINE = Math . cos ( 40 * DEGRESS_TO_RADIANS ) ;
7
9
8
10
/**
9
11
* Gesture attached to the content which the menu is assigned to
@@ -51,13 +53,13 @@ export class MenuContentGesture extends SlideEdgeGesture {
51
53
return true ;
52
54
}
53
55
54
- let cosine = Math . cos ( ev . angle * ( Math . PI / 180 ) ) ;
56
+ let cosine = Math . cos ( ev . angle * DEGRESS_TO_RADIANS ) ;
55
57
if ( menu . side === 'right' ) {
56
- if ( cosine < - 0.95 ) {
58
+ if ( cosine < - MIN_COSINE ) {
57
59
return super . canStart ( ev ) ;
58
60
}
59
61
} else {
60
- if ( cosine > 0.95 ) {
62
+ if ( cosine > MIN_COSINE ) {
61
63
return super . canStart ( ev ) ;
62
64
}
63
65
}
You can’t perform that action at this time.
0 commit comments