Permalink
Browse files

move (pan) view if necessary

  • Loading branch information...
justanotherfoundry committed Jul 2, 2018
1 parent fd5077e commit a9893808cef408d4172f413a929f62f70e165341
Showing with 14 additions and 0 deletions.
  1. +7 −0 Edit Next Glyph.py
  2. +7 −0 Edit Previous Glyph.py
@@ -21,3 +21,10 @@
except:
# this happens when the cursor reaches a line break
pass

layer = Glyphs.font.selectedLayers[0]
tab = Glyphs.font.currentTab
if tab.viewPort.origin.x + tab.viewPort.size.width < tab.bounds.origin.x + tab.bounds.size.width:
vp = tab.viewPort
vp.origin.x = tab.selectedLayerOrigin.x + 0.5 * ( layer.width * tab.scale - vp.size.width )
tab.viewPort = vp
@@ -21,3 +21,10 @@
except:
# this happens when the cursor reaches a line break
pass

layer = Glyphs.font.selectedLayers[0]
tab = Glyphs.font.currentTab
if tab.viewPort.origin.x > tab.bounds.origin.x:
vp = tab.viewPort
vp.origin.x = tab.selectedLayerOrigin.x + 0.5 * ( layer.width * tab.scale - vp.size.width )
tab.viewPort = vp

0 comments on commit a989380

Please sign in to comment.