[pypy-svn] r7267 - pypy/trunk/src/pypy/translator/tool/pygame

bob at codespeak.net bob at codespeak.net
Tue Nov 16 11:14:25 CET 2004


Author: bob
Date: Tue Nov 16 11:14:24 2004
New Revision: 7267

Modified:
   pypy/trunk/src/pypy/translator/tool/pygame/graphdisplay.py
Log:
implement panning



Modified: pypy/trunk/src/pypy/translator/tool/pygame/graphdisplay.py
==============================================================================
--- pypy/trunk/src/pypy/translator/tool/pygame/graphdisplay.py	(original)
+++ pypy/trunk/src/pypy/translator/tool/pygame/graphdisplay.py	Tue Nov 16 11:14:24 2004
@@ -138,6 +138,13 @@
     def zoom(self, scale):
         self.viewer.shiftscale(max(scale, self.calculate_zoom_to_fit()))
         self.updated_viewer()
+
+    def pan(self, (x, y)):
+        self.viewer.shiftoffset(x * (self.width // 8), y * (self.height // 8))
+        self.updated_viewer()
+
+    def fast_pan(self, (x, y)):
+        self.pan((x * 4, y * 4))
     
     def update_status_bar(self):
         self.statusbarinfo = None



More information about the Pypy-commit mailing list