1. Rune Halvorsen
  2. dragonfly-stp-1-screenwatcher

Commits

Rune Halvorsen  committed 45f931d

No need to pad mouse coords. Forwarded mouse events are relative to the tab, not the doc

  • Participants
  • Parent commits 831888c
  • Branches default

Comments (0)

Files changed (1)

File src/screenwatcher/screenwatcher.js

View file
 
   this._onImageMouseUp = function(evt, target)
   {
-    this._forwardMouse(_current_image_metrics.left + evt.offsetX,
-                       _current_image_metrics.top + evt.offsetY,
+    this._forwardMouse(evt.offsetX,
+                       evt.offsetY,
                        2);
   }
 
   this._onImageMouseDown = function(evt, target)
   {
-    this._forwardMouse(_current_image_metrics.left + evt.offsetX,
-                       _current_image_metrics.top + evt.offsetY,
+    this._forwardMouse(evt.offsetX,
+                       evt.offsetY,
                        1);
   }
 
     var diff = now - _last_move_timestamp;
       if (diff > _min_mouse_move_interval) {
         _last_move_timestamp = now;
-        this._forwardMouse(_current_image_metrics.left + evt.offsetX,
-                           _current_image_metrics.top + evt.offsetY);
+        this._forwardMouse(evt.offsetX,
+                           evt.offsetY);
       }
 
   }