Mercurial > hg > svcore
comparison 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 |
comparison
equal
deleted
inserted
replaced
1551:4de4284d0596 | 1552:05c3fbaec8ea |
---|---|
52 */ | 52 */ |
53 virtual ZoomLevel getNearestZoomLevel(ZoomLevel requestedZoomLevel, | 53 virtual ZoomLevel getNearestZoomLevel(ZoomLevel requestedZoomLevel, |
54 RoundingDirection = RoundNearest) | 54 RoundingDirection = RoundNearest) |
55 const | 55 const |
56 { | 56 { |
57 // canonicalise | |
58 if (requestedZoomLevel.level == 1) { | |
59 requestedZoomLevel.zone = ZoomLevel::FramesPerPixel; | |
60 } | |
57 if (getMaxZoomLevel() < requestedZoomLevel) return getMaxZoomLevel(); | 61 if (getMaxZoomLevel() < requestedZoomLevel) return getMaxZoomLevel(); |
58 else return requestedZoomLevel; | 62 else return requestedZoomLevel; |
59 } | 63 } |
60 | 64 |
61 /** | 65 /** |