Sat, 18 Mar 2017 14:19:22 +0100
Fixed the pinch gesture behavior.
(grafted from d0beabfaad4244a9c3f28777001ccd4d8f349c8b)
--- a/Graphics/PixmapDiagram.py Tue Mar 14 15:09:08 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 Tue Mar 14 15:09:08 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 Tue Mar 14 15:09:08 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 Tue Mar 14 15:09:08 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 Tue Mar 14 15:09:08 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 Tue Mar 14 15:09:08 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 Tue Mar 14 15:09:08 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 Tue Mar 14 15:09:08 2017 +0100 +++ b/WebBrowser/WebBrowserView.py Sat Mar 18 14:19:22 2017 +0100 @@ -1354,9 +1354,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()