Mercurial > hg > svcore
diff data/model/PowerOfTwoZoomConstraint.cpp @ 1450:a12fd0456f0c streaming-csv-writer
Merge from default branch
author | Chris Cannam |
---|---|
date | Tue, 17 Apr 2018 10:35:42 +0100 |
parents | 48e9f538e6e9 |
children | 710e6250a401 a7485c1bdba5 |
line wrap: on
line diff
--- a/data/model/PowerOfTwoZoomConstraint.cpp Tue Apr 17 10:03:51 2018 +0100 +++ b/data/model/PowerOfTwoZoomConstraint.cpp Tue Apr 17 10:35:42 2018 +0100 @@ -17,28 +17,28 @@ int PowerOfTwoZoomConstraint::getNearestBlockSize(int req, - RoundingDirection dir) const + RoundingDirection dir) const { int result = 0; for (int bs = 1; ; bs *= 2) { - if (bs >= req) { - if (dir == RoundNearest) { - if (bs - req < req - bs/2) { - result = bs; - break; - } else { - result = bs/2; - break; - } - } else if (dir == RoundDown) { - result = bs/2; - break; - } else { - result = bs; - break; - } - } + if (bs >= req) { + if (dir == RoundNearest) { + if (bs - req < req - bs/2) { + result = bs; + break; + } else { + result = bs/2; + break; + } + } else if (dir == RoundDown) { + result = bs/2; + break; + } else { + result = bs; + break; + } + } } if (result > getMaxZoomLevel()) result = getMaxZoomLevel();