diff base/ZoomConstraint.h @ 1552:05c3fbaec8ea

Introduce RelativelyFineZoomConstraint, which encodes more-or-less the scheme that was already used for the horizontal thumbwheel in the pane (which overrode the layers' own zoom constraints unless they said they couldn't support any other)
author Chris Cannam
date Wed, 10 Oct 2018 14:32:34 +0100
parents 1f72a44f5638
children
line wrap: on
line diff
--- a/base/ZoomConstraint.h	Wed Oct 10 08:44:15 2018 +0100
+++ b/base/ZoomConstraint.h	Wed Oct 10 14:32:34 2018 +0100
@@ -54,6 +54,10 @@
                                           RoundingDirection = RoundNearest)
         const
     {
+        // canonicalise
+        if (requestedZoomLevel.level == 1) {
+            requestedZoomLevel.zone = ZoomLevel::FramesPerPixel;
+        }
         if (getMaxZoomLevel() < requestedZoomLevel) return getMaxZoomLevel();
 	else return requestedZoomLevel;
     }