[mousetrap/gnome3-wip: 114/240] Removing extra call to pointer.get_location() and moving updating of pointer history next to updatin



commit 1c79dd0d976c0c889337345a5d64c0ebd6363bd7
Author: Stoney Jackson <dr stoney gmail com>
Date:   Sun Jun 22 01:00:09 2014 -0400

    Removing extra call to pointer.get_location() and moving updating
    of pointer history next to updating eye detection history.

 src/mousetrap/plugins/eyes.py |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/mousetrap/plugins/eyes.py b/src/mousetrap/plugins/eyes.py
index 0aa8aa2..b595c13 100644
--- a/src/mousetrap/plugins/eyes.py
+++ b/src/mousetrap/plugins/eyes.py
@@ -15,15 +15,14 @@ class EyesPlugin(interface.Plugin):
 
     def run(self, app):
         self._eye_detection_history.append(self._left_locator.locate(app.image))
+        self._pointer_history.append(app.pointer.get_position())
 
         if self._stationary(app) and self._detect_closed():
             self._eye_detection_history.clear()
             app.pointer.click()
 
     def _stationary(self, app):
-        self._pointer_history.append(app.pointer.get_position())
-
-        last_point = app.pointer.get_position()
+        last_point = self._pointer_history[-1]
 
         for point in self._pointer_history:
             if point != last_point:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]