Mercurial > hg > svcore
comparison base/ZoomConstraint.h @ 12:f67ddc287bc3
* Add ability to create empty layers for editing
* Add first basic editing capability (adding points to a time instant layer)
* Add various keyboard and mouse shortcuts for navigation &c
* Add ability to resize a selection by dragging its edges
* Add maximum zoom level
author | Chris Cannam |
---|---|
date | Thu, 26 Jan 2006 16:15:40 +0000 |
parents | d86891498eef |
children | 070e9e1e40ea |
comparison
equal
deleted
inserted
replaced
11:cb05ba39664a | 12:f67ddc287bc3 |
---|---|
15 /** | 15 /** |
16 * ZoomConstraint is a simple interface that describes a limitation on | 16 * ZoomConstraint is a simple interface that describes a limitation on |
17 * the available zoom sizes for a view, for example based on cache | 17 * the available zoom sizes for a view, for example based on cache |
18 * strategy or a (processing) window-size limitation. | 18 * strategy or a (processing) window-size limitation. |
19 * | 19 * |
20 * The default ZoomConstraint imposes no actual constraint. | 20 * The default ZoomConstraint imposes no actual constraint except for |
21 * a nominal maximum. | |
21 */ | 22 */ |
22 | 23 |
23 class ZoomConstraint | 24 class ZoomConstraint |
24 { | 25 { |
25 public: | 26 public: |
41 */ | 42 */ |
42 virtual size_t getNearestBlockSize(size_t requestedBlockSize, | 43 virtual size_t getNearestBlockSize(size_t requestedBlockSize, |
43 RoundingDirection = RoundNearest) | 44 RoundingDirection = RoundNearest) |
44 const | 45 const |
45 { | 46 { |
46 return requestedBlockSize; | 47 if (requestedBlockSize > getMaxZoomLevel()) return getMaxZoomLevel(); |
48 else return requestedBlockSize; | |
47 } | 49 } |
50 | |
51 virtual size_t getMaxZoomLevel() const { return 262144; } | |
48 }; | 52 }; |
49 | 53 |
50 #endif | 54 #endif |
51 | 55 |