Mercurial > hg > svcore
diff data/model/PowerOfSqrtTwoZoomConstraint.cpp @ 1057:5c5d4863b428 tonioni
Merge from cxx11 branch
author | Chris Cannam |
---|---|
date | Mon, 23 Mar 2015 11:26:28 +0000 |
parents | cc27f35aa75c |
children | d4a28d1479a8 48e9f538e6e9 |
line wrap: on
line diff
--- a/data/model/PowerOfSqrtTwoZoomConstraint.cpp Mon Mar 23 10:04:48 2015 +0000 +++ b/data/model/PowerOfSqrtTwoZoomConstraint.cpp Mon Mar 23 11:26:28 2015 +0000 @@ -44,12 +44,13 @@ float val = 1.0, prevVal = 1.0; while (val + 0.01 < blockSize) { prevVal = val; - val *= sqrt(2.f); + val *= sqrtf(2.f); } int rval; - if (dir == RoundUp) rval = int(val + 0.01); - else if (dir == RoundDown) rval = int(prevVal + 0.01); - else if (val - blockSize < blockSize - prevVal) rval = int(val + 0.01); + if (dir == RoundUp) rval = int(val + 0.01f); + else if (dir == RoundDown) rval = int(prevVal + 0.01f); + else if (val - float(blockSize) < + float(blockSize) - prevVal) rval = int(val + 0.01f); else rval = int(prevVal + 0.01); // SVDEBUG << "returning " << rval << endl; return rval;