File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,19 @@ export function getPrecision (step) {
35
35
}
36
36
37
37
export function getMousePosition ( vertical , e ) {
38
- return vertical ? e . clientY : e . pageX
38
+ let zoom = 1
39
+ if ( window . visualViewport ) {
40
+ zoom = + ( window . visualViewport . width / document . body . getBoundingClientRect ( ) . width ) . toFixed ( 2 )
41
+ }
42
+ return ( vertical ? e . clientY : e . pageX ) / zoom
39
43
}
40
44
41
45
export function getTouchPosition ( vertical , e ) {
42
- return vertical ? e . touches [ 0 ] . clientY : e . touches [ 0 ] . pageX
46
+ let zoom = 1
47
+ if ( window . visualViewport ) {
48
+ zoom = + ( window . visualViewport . width / document . body . getBoundingClientRect ( ) . width ) . toFixed ( 2 )
49
+ }
50
+ return ( vertical ? e . touches [ 0 ] . clientY : e . touches [ 0 ] . pageX ) / zoom
43
51
}
44
52
45
53
export function getHandleCenterPosition ( vertical , handle ) {
You can’t perform that action at this time.
0 commit comments