Mercurial > hg > svcore
comparison base/ZoomConstraint.h @ 1429:48e9f538e6e9
Untabify
author | Chris Cannam |
---|---|
date | Thu, 01 Mar 2018 18:02:22 +0000 |
parents | 12f3b48668d4 |
children | 710e6250a401 a7485c1bdba5 |
comparison
equal
deleted
inserted
replaced
1428:87ae75da6527 | 1429:48e9f538e6e9 |
---|---|
31 { | 31 { |
32 public: | 32 public: |
33 virtual ~ZoomConstraint() { } | 33 virtual ~ZoomConstraint() { } |
34 | 34 |
35 enum RoundingDirection { | 35 enum RoundingDirection { |
36 RoundDown, | 36 RoundDown, |
37 RoundUp, | 37 RoundUp, |
38 RoundNearest | 38 RoundNearest |
39 }; | 39 }; |
40 | 40 |
41 /** | 41 /** |
42 * Given the "ideal" block size (frames per pixel) for a given | 42 * Given the "ideal" block size (frames per pixel) for a given |
43 * zoom level, return the nearest viable block size for this | 43 * zoom level, return the nearest viable block size for this |
47 * requested but the underlying model only supports value | 47 * requested but the underlying model only supports value |
48 * summaries at powers-of-two block sizes, return 1024 or 2048 | 48 * summaries at powers-of-two block sizes, return 1024 or 2048 |
49 * depending on the rounding direction supplied. | 49 * depending on the rounding direction supplied. |
50 */ | 50 */ |
51 virtual int getNearestBlockSize(int requestedBlockSize, | 51 virtual int getNearestBlockSize(int requestedBlockSize, |
52 RoundingDirection = RoundNearest) | 52 RoundingDirection = RoundNearest) |
53 const | 53 const |
54 { | 54 { |
55 if (requestedBlockSize > getMaxZoomLevel()) return getMaxZoomLevel(); | 55 if (requestedBlockSize > getMaxZoomLevel()) return getMaxZoomLevel(); |
56 else return requestedBlockSize; | 56 else return requestedBlockSize; |
57 } | 57 } |
58 | 58 |
59 /** | 59 /** |
60 * Return the maximum zoom level within range for this constraint. | 60 * Return the maximum zoom level within range for this constraint. |
61 * This is quite large -- individual views will probably want to | 61 * This is quite large -- individual views will probably want to |