Permalink
Browse files

Merge pull request #189 from hurzl/experimental

preview zoom by key
  • Loading branch information...
2 parents 1b28112 + 5c22914 commit 36a2034a87464aedc4b45b1269b2e51152e03d5b @kliment committed Mar 5, 2012
Showing with 12 additions and 4 deletions.
  1. +12 −4 gviz.py
View
16 gviz.py
@@ -47,13 +47,21 @@ def mouse(self,event):
else:
event.Skip()
+
def key(self, event):
x=event.GetKeyCode()
+ if event.ShiftDown():
+ cx,cy=self.p.translate
+ if x==wx.WXK_UP:
+ self.p.zoom(cx,cy,1.2)
+ if x==wx.WXK_DOWN:
+ self.p.zoom(cx,cy,1/1.2)
+ else:
+ if x==wx.WXK_UP:
+ self.p.layerup()
+ if x==wx.WXK_DOWN:
+ self.p.layerdown()
#print x
- if x==wx.WXK_UP:
- self.p.layerup()
- if x==wx.WXK_DOWN:
- self.p.layerdown()
#print p.lines.keys()
def zoom(self, event):

0 comments on commit 36a2034

Please sign in to comment.