Commit 826c9ed7 authored by Guillaume Seguin's avatar Guillaume Seguin

Fix zooming using keystrokes in gcview

parent 09fe67b5
...@@ -411,23 +411,22 @@ class GcodeViewPanel(wxGLPanel): ...@@ -411,23 +411,22 @@ class GcodeViewPanel(wxGLPanel):
def keypress(self, event): def keypress(self, event):
"""gets keypress events and moves/rotates acive shape""" """gets keypress events and moves/rotates acive shape"""
keycode = event.GetKeyCode() step = 1.1
step = 10
if event.ControlDown(): if event.ControlDown():
step = 3 step = 1.05
kup = [85, 315] # Up keys kup = [85, 315] # Up keys
kdo = [68, 317] # Down Keys kdo = [68, 317] # Down Keys
kzi = [wx.WXK_PAGEDOWN, 388, 316, 61] # Zoom In Keys kzi = [wx.WXK_PAGEDOWN, 388, 316, 61] # Zoom In Keys
kzo = [wx.WXK_PAGEUP, 390, 314, 45] # Zoom Out Keys kzo = [wx.WXK_PAGEUP, 390, 314, 45] # Zoom Out Keys
x = event.GetKeyCode() key = event.GetKeyCode()
if x in kup: if key in kup:
self.layerup() self.layerup()
if x in kdo: if key in kdo:
self.layerdown() self.layerdown()
if x in kzi: if key in kzi:
self.zoom(step) self.zoom(step)
if x in kzo: if key in kzo:
self.zoom(-step) self.zoom(1 / step)
event.Skip() event.Skip()
wx.CallAfter(self.Refresh) wx.CallAfter(self.Refresh)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment