diff framework/SVFileReader.cpp @ 624:15a566f26114 zoom

ZoomLevel fixes
author Chris Cannam
date Thu, 20 Sep 2018 11:45:37 +0100
parents 021d42e6c8cb
children 10046d544e76
line wrap: on
line diff
--- a/framework/SVFileReader.cpp	Wed Sep 12 15:58:35 2018 +0100
+++ b/framework/SVFileReader.cpp	Thu Sep 20 11:45:37 2018 +0100
@@ -769,6 +769,14 @@
     READ_MANDATORY(int, followZoom, toInt);
     QString tracking = attributes.value("tracking");
 
+    ZoomLevel zoomLevel;
+    int deepZoom = attributes.value("deepZoom").trimmed().toInt(&ok);
+    if (ok && zoom == 1 && deepZoom > 1) {
+        zoomLevel = { ZoomLevel::PixelsPerFrame, deepZoom };
+    } else {
+        zoomLevel = { ZoomLevel::FramesPerPixel, zoom };
+    }
+
     // Specify the follow modes before we set the actual values
     view->setFollowGlobalPan(followPan);
     view->setFollowGlobalZoom(followZoom);
@@ -779,7 +787,7 @@
 
     // Then set these values
     view->setCentreFrame(centre);
-    view->setZoomLevel(zoom);
+    view->setZoomLevel(zoomLevel);
 
     // And pane properties
     READ_MANDATORY(int, centreLineVisible, toInt);