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) {
3535}
3636
3737export 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
3943}
4044
4145export 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
4351}
4452
4553export function getHandleCenterPosition ( vertical , handle ) {
You can’t perform that action at this time.
0 commit comments