Fixed the pinch gesture behavior.

Sat, 18 Mar 2017 14:19:22 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 18 Mar 2017 14:19:22 +0100
changeset 5631
d0beabfaad42
parent 5630
11670490db05
child 5632
d8ba4e4779a3

Fixed the pinch gesture behavior.

Graphics/PixmapDiagram.py file | annotate | diff | comparison | revisions
Graphics/SvgDiagram.py file | annotate | diff | comparison | revisions
Graphics/UMLGraphicsView.py file | annotate | diff | comparison | revisions
Helpviewer/HelpBrowserWV.py file | annotate | diff | comparison | revisions
IconEditor/IconEditorWindow.py file | annotate | diff | comparison | revisions
QScintilla/Editor.py file | annotate | diff | comparison | revisions
QScintilla/Shell.py file | annotate | diff | comparison | revisions
WebBrowser/WebBrowserView.py file | annotate | diff | comparison | revisions
--- a/Graphics/PixmapDiagram.py	Sat Mar 18 13:05:41 2017 +0100
+++ b/Graphics/PixmapDiagram.py	Sat Mar 18 14:19:22 2017 +0100
@@ -222,9 +222,9 @@
         pinch = evt.gesture(Qt.PinchGesture)
         if pinch:
             if pinch.state() == Qt.GestureStarted:
-                pinch.setScaleFactor(self.__zoom() / 100)
-            else:
-                self.__doZoom(int(pinch.scaleFactor() * 100))
+                pinch.setTotalScaleFactor(self.__zoom() / 100)
+            elif pinch.state() == Qt.GestureUpdated:
+                self.__doZoom(int(pinch.totalScaleFactor() * 100))
             evt.accept()
     
     ###########################################################################
--- a/Graphics/SvgDiagram.py	Sat Mar 18 13:05:41 2017 +0100
+++ b/Graphics/SvgDiagram.py	Sat Mar 18 14:19:22 2017 +0100
@@ -192,9 +192,9 @@
         pinch = evt.gesture(Qt.PinchGesture)
         if pinch:
             if pinch.state() == Qt.GestureStarted:
-                pinch.setScaleFactor(self.__zoom() / 100)
-            else:
-                self.__doZoom(int(pinch.scaleFactor() * 100))
+                pinch.setTotalScaleFactor(self.__zoom() / 100)
+            elif pinch.state() == Qt.GestureUpdated:
+                self.__doZoom(int(pinch.totalScaleFactor() * 100))
             evt.accept()
     
     ###########################################################################
--- a/Graphics/UMLGraphicsView.py	Sat Mar 18 13:05:41 2017 +0100
+++ b/Graphics/UMLGraphicsView.py	Sat Mar 18 14:19:22 2017 +0100
@@ -636,9 +636,9 @@
         pinch = evt.gesture(Qt.PinchGesture)
         if pinch:
             if pinch.state() == Qt.GestureStarted:
-                pinch.setScaleFactor(self.zoom() / 100.0)
-            else:
-                self.setZoom(int(pinch.scaleFactor() * 100))
+                pinch.setTotalScaleFactor(self.zoom() / 100.0)
+            elif pinch.state() == Qt.GestureUpdated:
+                self.setZoom(int(pinch.totalScaleFactor() * 100))
             evt.accept()
     
     def getItemId(self):
--- a/Helpviewer/HelpBrowserWV.py	Sat Mar 18 13:05:41 2017 +0100
+++ b/Helpviewer/HelpBrowserWV.py	Sat Mar 18 14:19:22 2017 +0100
@@ -1965,9 +1965,9 @@
         pinch = evt.gesture(Qt.PinchGesture)
         if pinch:
             if pinch.state() == Qt.GestureStarted:
-                pinch.setScaleFactor(self.__currentZoom / 100.0)
-            else:
-                scaleFactor = pinch.scaleFactor()
+                pinch.setTotalScaleFactor(self.__currentZoom / 100.0)
+            elif pinch.state() == Qt.GestureUpdated:
+                scaleFactor = pinch.totalScaleFactor()
                 self.__currentZoom = int(scaleFactor * 100)
                 self.__applyZoom()
             evt.accept()
--- a/IconEditor/IconEditorWindow.py	Sat Mar 18 13:05:41 2017 +0100
+++ b/IconEditor/IconEditorWindow.py	Sat Mar 18 14:19:22 2017 +0100
@@ -1387,8 +1387,8 @@
         pinch = evt.gesture(Qt.PinchGesture)
         if pinch:
             if pinch.state() == Qt.GestureStarted:
-                pinch.setScaleFactor(self.__editor.zoomFactor() / 100.0)
-            else:
-                self.__editor.setZoomFactor(int(pinch.scaleFactor() * 100))
+                pinch.setTotalScaleFactor(self.__editor.zoomFactor() / 100.0)
+            elif pinch.state() == Qt.GestureUpdated:
+                self.__editor.setZoomFactor(int(pinch.totalScaleFactor() * 100))
                 self.__updateZoom()
             evt.accept()
--- a/QScintilla/Editor.py	Sat Mar 18 13:05:41 2017 +0100
+++ b/QScintilla/Editor.py	Sat Mar 18 14:19:22 2017 +0100
@@ -6560,15 +6560,15 @@
         if pinch:
             if pinch.state() == Qt.GestureStarted:
                 zoom = (self.getZoom() + 10) / 10.0
-                pinch.setScaleFactor(zoom)
-            else:
-                zoom = int(pinch.scaleFactor() * 10) - 10
+                pinch.setTotalScaleFactor(zoom)
+            elif pinch.state() == Qt.GestureUpdated:
+                zoom = int(pinch.totalScaleFactor() * 10) - 10
                 if zoom <= -9:
                     zoom = -9
-                    pinch.setScaleFactor(0.1)
+                    pinch.setTotalScaleFactor(0.1)
                 elif zoom >= 20:
                     zoom = 20
-                    pinch.setScaleFactor(3.0)
+                    pinch.setTotalScaleFactor(3.0)
                 self.zoomTo(zoom)
             evt.accept()
     
--- a/QScintilla/Shell.py	Sat Mar 18 13:05:41 2017 +0100
+++ b/QScintilla/Shell.py	Sat Mar 18 14:19:22 2017 +0100
@@ -998,15 +998,15 @@
         if pinch:
             if pinch.state() == Qt.GestureStarted:
                 zoom = (self.getZoom() + 10) / 10.0
-                pinch.setScaleFactor(zoom)
-            else:
-                zoom = int(pinch.scaleFactor() * 10) - 10
+                pinch.setTotalScaleFactor(zoom)
+            elif pinch.state() == Qt.GestureUpdated:
+                zoom = int(pinch.totalScaleFactor() * 10) - 10
                 if zoom <= -9:
                     zoom = -9
-                    pinch.setScaleFactor(0.1)
+                    pinch.setTotalScaleFactor(0.1)
                 elif zoom >= 20:
                     zoom = 20
-                    pinch.setScaleFactor(3.0)
+                    pinch.setTotalScaleFactor(3.0)
                 self.zoomTo(zoom)
             evt.accept()
     
--- a/WebBrowser/WebBrowserView.py	Sat Mar 18 13:05:41 2017 +0100
+++ b/WebBrowser/WebBrowserView.py	Sat Mar 18 14:19:22 2017 +0100
@@ -1371,9 +1371,9 @@
         pinch = evt.gesture(Qt.PinchGesture)
         if pinch:
             if pinch.state() == Qt.GestureStarted:
-                pinch.setScaleFactor(self.__currentZoom / 100.0)
-            else:
-                scaleFactor = pinch.scaleFactor()
+                pinch.setTotalScaleFactor(self.__currentZoom / 100.0)
+            elif pinch.state() == Qt.GestureUpdated:
+                scaleFactor = pinch.totalScaleFactor()
                 self.setZoomValue(int(scaleFactor * 100))
             evt.accept()
     

eric ide

mercurial