diff data/model/PowerOfSqrtTwoZoomConstraint.cpp @ 377:166c22eff678

* Ensure waveforms are strictly correct even when using a non-power-of-two non-power-of-sqrt-two block size with cacheing off and painting only small areas at a time
author Chris Cannam
date Thu, 07 Feb 2008 15:25:05 +0000
parents 3a13b0d4934e
children d7f3dfe6f9a4
line wrap: on
line diff
--- a/data/model/PowerOfSqrtTwoZoomConstraint.cpp	Thu Feb 07 12:36:59 2008 +0000
+++ b/data/model/PowerOfSqrtTwoZoomConstraint.cpp	Thu Feb 07 15:25:05 2008 +0000
@@ -75,7 +75,13 @@
 	}
 
 //	std::cerr << "Testing base " << base << std::endl;
-	if (base >= blockSize) {
+
+        if (base == blockSize) {
+            result = base;
+            break;
+        }
+
+	if (base > blockSize) {
 	    if (dir == RoundNearest) {
 		if (base - blockSize < blockSize - prevBase) {
 		    dir = RoundUp;