diff src/DynamicVector.cpp @ 23:032edf186a68

bug fixed on draw vector fn, likelihood drawing fine now
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Wed, 30 Nov 2011 12:35:04 +0000
parents 9860abc92a30
children
line wrap: on
line diff
--- a/src/DynamicVector.cpp	Wed Nov 30 11:48:35 2011 +0000
+++ b/src/DynamicVector.cpp	Wed Nov 30 12:35:04 2011 +0000
@@ -233,10 +233,10 @@
 		int startInt = max(1,minIndex+1);
 		int endInt = min(maxIndex, (int)array.size());
 		double heightConstant = screenHeight / maxVal;
-		int lastHeightPixel = heightConstant * (1 - array[startInt-1]);
+		int lastHeightPixel = heightConstant * (maxVal - array[startInt-1]);
 		int newHeightPixel;
 		for (int i = startInt;i < endInt;i++){
-			newHeightPixel = (int) heightConstant * (1 - array[i]);
+			newHeightPixel = (int) heightConstant * (maxVal - array[i]);
 			ofLine (stepSize*(i-1), lastHeightPixel, stepSize*i, newHeightPixel);
 			lastHeightPixel = newHeightPixel;
 		}