mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Fix mouse move.
This commit is contained in:
parent
3d15470d3d
commit
377c32a33b
@ -286,11 +286,13 @@ export function ApplyInputHandlers() {
|
||||
if (e.touches.length == 2) {
|
||||
let touchMove1 = lastScrollTouchY1 - e.touches[0].pageY;
|
||||
let touchMove2 = lastScrollTouchY2 - e.touches[1].pageY;
|
||||
if (!isPinchZooming && (isScrolling || touchMove1 * touchMove2 > 10)) {
|
||||
if (!isPinchZooming && (isScrolling || touchMove1 * touchMove2 > 0)) {
|
||||
// Both touch points are moving in the same direction. We're doing a scroll.
|
||||
if (!isScrolling) {
|
||||
// If this is the start of scrolling, move the mouse to our touch point so
|
||||
// the scroll wheel action will target the intended element on screen.
|
||||
var screenViewerLeft = viewer.getBoundingClientRect().left;
|
||||
var screenViewerTop = viewer.getBoundingClientRect().top;
|
||||
var pagePercentX = (e.touches[0].pageX - screenViewerLeft) / viewer.clientWidth;
|
||||
var pagePercentY = (e.touches[0].pageY - screenViewerTop) / viewer.clientHeight;
|
||||
ViewerApp.MessageSender.SendMouseMove(pagePercentX, pagePercentY);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -357,12 +357,14 @@ export function ApplyInputHandlers() {
|
||||
let touchMove1 = lastScrollTouchY1 - e.touches[0].pageY;
|
||||
let touchMove2 = lastScrollTouchY2 - e.touches[1].pageY;
|
||||
|
||||
if (!isPinchZooming && (isScrolling || touchMove1 * touchMove2 > 10)) {
|
||||
if (!isPinchZooming && (isScrolling || touchMove1 * touchMove2 > 0)) {
|
||||
// Both touch points are moving in the same direction. We're doing a scroll.
|
||||
|
||||
if (!isScrolling) {
|
||||
// If this is the start of scrolling, move the mouse to our touch point so
|
||||
// the scroll wheel action will target the intended element on screen.
|
||||
var screenViewerLeft = viewer.getBoundingClientRect().left;
|
||||
var screenViewerTop = viewer.getBoundingClientRect().top;
|
||||
var pagePercentX = (e.touches[0].pageX - screenViewerLeft) / viewer.clientWidth;
|
||||
var pagePercentY = (e.touches[0].pageY - screenViewerTop) / viewer.clientHeight;
|
||||
ViewerApp.MessageSender.SendMouseMove(pagePercentX, pagePercentY);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user