Changeset a5b79eb in guacamole-common-js


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

Mouse acceleration.

File:
1 edited

Legend:

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

    raf661f4 ra5b79eb  
    278278        if (touch_count == 1) { 
    279279 
     280            // Calculate average velocity in Manhatten pixels per millisecond 
     281            var velocity = pixels_moved / (new Date().getTime() - last_touch_time); 
     282 
     283            // Scale mouse movement relative to velocity 
     284            var scale = 1 + velocity; 
     285 
    280286            // Update mouse location 
    281             guac_mouse.currentState.x += delta_x; 
    282             guac_mouse.currentState.y += delta_y; 
     287            guac_mouse.currentState.x += delta_x*scale; 
     288            guac_mouse.currentState.y += delta_y*scale; 
    283289 
    284290            // Prevent mouse from leaving screen 
Note: See TracChangeset for help on using the changeset viewer.