Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Fix touchpad zooming

manongjohn2c7a66239ef0
diff --git a/toonz/sources/toonzqt/schematicviewer.cpp b/toonz/sources/toonzqt/schematicviewer.cpp
index c322e0e64..5e3deb13c 100644
--- a/toonz/sources/toonzqt/schematicviewer.cpp
+++ b/toonz/sources/toonzqt/schematicviewer.cpp
@@ -426,14 +426,16 @@ void SchematicSceneViewer::zoomQt(bool zoomin, bool resetZoom) {
*/
void SchematicSceneViewer::changeScale(const QPoint &winPos,
qreal scaleFactor) {
+ int devPixRatio =
+ m_touchDevice == QTouchDevice::TouchScreen ? 1 : getDevPixRatio();
QPointF startScenePos = m_touchDevice == QTouchDevice::TouchScreen
? mapToScene(winPos)
- : winPos * getDevPixRatio();
+ : winPos * devPixRatio;
QMatrix scale = QMatrix().scale(scaleFactor, scaleFactor);
setMatrix(scale, true);
QPointF endScenePos = m_touchDevice == QTouchDevice::TouchScreen
? mapToScene(winPos)
- : winPos * getDevPixRatio();
+ : winPos * devPixRatio;
QPointF delta = endScenePos - startScenePos;
translate(delta.x(), delta.y());
}