Changeset af661f4 in guacamole-common-js


Ignore:
Timestamp:
04/09/12 00:22:09 (14 months ago)
Author:
zhangmaike
Branches:
master, guacamole-debian-parent, unstable
Children:
a5b79eb
Parents:
a76549c
git-author:
Michael Jumper <zhangmaike@…> (04/09/12 00:22:09)
git-committer:
Michael Jumper <zhangmaike@…> (04/09/12 00:22:09)
Message:

Avoid crazy accelerating autoscroll by using clientX/clientY instead of screenX/screenY.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/resources/mouse.js

    ra76549c raf661f4  
    254254            // Record touch location and time 
    255255            var starting_touch = e.touches[0]; 
    256             last_touch_x = starting_touch.screenX; 
    257             last_touch_y = starting_touch.screenY; 
     256            last_touch_x = starting_touch.clientX; 
     257            last_touch_y = starting_touch.clientY; 
    258258            last_touch_time = new Date().getTime(); 
    259259            pixels_moved = 0; 
     
    269269        // Get change in touch location 
    270270        var touch = e.touches[0]; 
    271         var delta_x = touch.screenX - last_touch_x; 
    272         var delta_y = touch.screenY - last_touch_y; 
     271        var delta_x = touch.clientX - last_touch_x; 
     272        var delta_y = touch.clientY - last_touch_y; 
    273273 
    274274        // Track pixels moved 
     
    299299 
    300300            // Update touch location 
    301             last_touch_x = touch.screenX; 
    302             last_touch_y = touch.screenY; 
     301            last_touch_x = touch.clientX; 
     302            last_touch_y = touch.clientY; 
    303303 
    304304        } 
     
    327327                // Only update touch location after a scroll has been 
    328328                // detected 
    329                 last_touch_x = touch.screenX; 
    330                 last_touch_y = touch.screenY; 
     329                last_touch_x = touch.clientX; 
     330                last_touch_y = touch.clientY; 
    331331 
    332332            } 
Note: See TracChangeset for help on using the changeset viewer.