Mercurial > hg > svcore
comparison data/model/PowerOfSqrtTwoZoomConstraint.cpp @ 383:94fc0591ea43 1.2-stable
* merge from trunk (1.2 ended up being tracked from trunk, but we may want
this branch for fixes later)
author | Chris Cannam |
---|---|
date | Wed, 27 Feb 2008 10:32:45 +0000 |
parents | 3a13b0d4934e |
children | d7f3dfe6f9a4 |
comparison
equal
deleted
inserted
replaced
349:f39d33b0b265 | 383:94fc0591ea43 |
---|---|
73 base = (((unsigned int)((1 << minCachePower) * sqrt(2) + 0.01)) | 73 base = (((unsigned int)((1 << minCachePower) * sqrt(2) + 0.01)) |
74 << (power - minCachePower)); | 74 << (power - minCachePower)); |
75 } | 75 } |
76 | 76 |
77 // std::cerr << "Testing base " << base << std::endl; | 77 // std::cerr << "Testing base " << base << std::endl; |
78 if (base >= blockSize) { | 78 |
79 if (base == blockSize) { | |
80 result = base; | |
81 break; | |
82 } | |
83 | |
84 if (base > blockSize) { | |
79 if (dir == RoundNearest) { | 85 if (dir == RoundNearest) { |
80 if (base - blockSize < blockSize - prevBase) { | 86 if (base - blockSize < blockSize - prevBase) { |
81 dir = RoundUp; | 87 dir = RoundUp; |
82 } else { | 88 } else { |
83 dir = RoundDown; | 89 dir = RoundDown; |