QScintilla/Shell.py

branch
maintenance
changeset 5633
1a767ca5bbf3
parent 5612
ec9b9badcfdf
child 5680
b93cb6353cc0
equal deleted inserted replaced
5612:ec9b9badcfdf 5633:1a767ca5bbf3
996 """ 996 """
997 pinch = evt.gesture(Qt.PinchGesture) 997 pinch = evt.gesture(Qt.PinchGesture)
998 if pinch: 998 if pinch:
999 if pinch.state() == Qt.GestureStarted: 999 if pinch.state() == Qt.GestureStarted:
1000 zoom = (self.getZoom() + 10) / 10.0 1000 zoom = (self.getZoom() + 10) / 10.0
1001 pinch.setScaleFactor(zoom) 1001 pinch.setTotalScaleFactor(zoom)
1002 else: 1002 elif pinch.state() == Qt.GestureUpdated:
1003 zoom = int(pinch.scaleFactor() * 10) - 10 1003 zoom = int(pinch.totalScaleFactor() * 10) - 10
1004 if zoom <= -9: 1004 if zoom <= -9:
1005 zoom = -9 1005 zoom = -9
1006 pinch.setScaleFactor(0.1) 1006 pinch.setTotalScaleFactor(0.1)
1007 elif zoom >= 20: 1007 elif zoom >= 20:
1008 zoom = 20 1008 zoom = 20
1009 pinch.setScaleFactor(3.0) 1009 pinch.setTotalScaleFactor(3.0)
1010 self.zoomTo(zoom) 1010 self.zoomTo(zoom)
1011 evt.accept() 1011 evt.accept()
1012 1012
1013 def editorCommand(self, cmd): 1013 def editorCommand(self, cmd):
1014 """ 1014 """

eric ide

mercurial